shakapacker 8.0.0 → 8.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dummy.yml +1 -1
  3. data/.github/workflows/generator.yml +5 -1
  4. data/.github/workflows/node.yml +1 -1
  5. data/.github/workflows/ruby.yml +8 -2
  6. data/.gitignore +0 -1
  7. data/.node-version +1 -1
  8. data/CHANGELOG.md +27 -11
  9. data/Gemfile.lock +257 -0
  10. data/README.md +11 -12
  11. data/__mocks__/nonexistent/package.json +4 -0
  12. data/__mocks__/sass-loader/package.json +4 -0
  13. data/docs/customizing_babel_config.md +32 -4
  14. data/docs/react.md +3 -2
  15. data/docs/troubleshooting.md +1 -1
  16. data/docs/using_esbuild_loader.md +1 -1
  17. data/docs/v8_upgrade.md +2 -2
  18. data/jest.config.js +2 -1
  19. data/lib/shakapacker/version.rb +1 -1
  20. data/package/rules/sass.js +8 -6
  21. data/package/utils/helpers.js +9 -1
  22. data/package.json +2 -2
  23. data/shakapacker.gemspec +5 -2
  24. data/test/package/development.test.js +9 -0
  25. data/test/package/environments/base.test.js +9 -0
  26. data/test/package/environments/development.test.js +9 -0
  27. data/test/package/environments/production.test.js +9 -0
  28. data/test/package/helpers.test.js +11 -0
  29. data/test/package/index.test.js +9 -0
  30. data/test/package/production.test.js +9 -0
  31. data/test/package/rules/index.test.js +9 -0
  32. data/test/package/rules/sass.test.js +23 -0
  33. data/test/package/rules/sass1.test.js +23 -0
  34. data/test/package/staging.test.js +9 -0
  35. data/test/package/test.test.js +9 -0
  36. data/test/resolver.js +13 -0
  37. metadata +15 -235
  38. data/lib/install/bin/yarn +0 -18
  39. data/rakelib/release.rake +0 -65
  40. data/spec/dummy/.browserslistrc +0 -1
  41. data/spec/dummy/.gitignore +0 -20
  42. data/spec/dummy/.prettierrc.yaml +0 -4
  43. data/spec/dummy/Gemfile +0 -61
  44. data/spec/dummy/Procfile.dev +0 -5
  45. data/spec/dummy/Procfile.dev-static +0 -9
  46. data/spec/dummy/README.md +0 -1
  47. data/spec/dummy/Rakefile +0 -6
  48. data/spec/dummy/app/assets/config/manifest.js +0 -2
  49. data/spec/dummy/app/assets/images/.keep +0 -0
  50. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  51. data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
  52. data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
  53. data/spec/dummy/app/controllers/application_controller.rb +0 -2
  54. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  55. data/spec/dummy/app/controllers/hello_world_controller.rb +0 -9
  56. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  57. data/spec/dummy/app/javascript/Globals.d.ts +0 -3
  58. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +0 -25
  59. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.tsx +0 -47
  60. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorldServer.tsx +0 -5
  61. data/spec/dummy/app/javascript/bundles/HelloWorld/components/logo.svg +0 -7
  62. data/spec/dummy/app/javascript/packs/application.js +0 -17
  63. data/spec/dummy/app/javascript/packs/hello-world-bundle.ts +0 -8
  64. data/spec/dummy/app/javascript/packs/server-bundle.ts +0 -8
  65. data/spec/dummy/app/jobs/application_job.rb +0 -7
  66. data/spec/dummy/app/mailers/application_mailer.rb +0 -4
  67. data/spec/dummy/app/models/application_record.rb +0 -3
  68. data/spec/dummy/app/models/concerns/.keep +0 -0
  69. data/spec/dummy/app/views/hello_world/index.html.erb +0 -2
  70. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  71. data/spec/dummy/app/views/layouts/hello_world.html.erb +0 -13
  72. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  73. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  74. data/spec/dummy/babel.config.js +0 -30
  75. data/spec/dummy/bin/bundle +0 -114
  76. data/spec/dummy/bin/dev +0 -30
  77. data/spec/dummy/bin/dev-static +0 -30
  78. data/spec/dummy/bin/rails +0 -9
  79. data/spec/dummy/bin/rake +0 -9
  80. data/spec/dummy/bin/setup +0 -33
  81. data/spec/dummy/bin/shakapacker +0 -13
  82. data/spec/dummy/bin/shakapacker-dev-server +0 -13
  83. data/spec/dummy/bin/spring +0 -17
  84. data/spec/dummy/bin/yarn +0 -18
  85. data/spec/dummy/config/application.rb +0 -35
  86. data/spec/dummy/config/boot.rb +0 -4
  87. data/spec/dummy/config/cable.yml +0 -10
  88. data/spec/dummy/config/credentials.yml.enc +0 -1
  89. data/spec/dummy/config/database.yml +0 -25
  90. data/spec/dummy/config/environment.rb +0 -5
  91. data/spec/dummy/config/environments/development.rb +0 -54
  92. data/spec/dummy/config/environments/production.rb +0 -106
  93. data/spec/dummy/config/environments/test.rb +0 -49
  94. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
  95. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  96. data/spec/dummy/config/initializers/content_security_policy.rb +0 -28
  97. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
  98. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  99. data/spec/dummy/config/initializers/inflections.rb +0 -16
  100. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  101. data/spec/dummy/config/initializers/react_on_rails.rb +0 -58
  102. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  103. data/spec/dummy/config/locales/en.yml +0 -33
  104. data/spec/dummy/config/puma.rb +0 -38
  105. data/spec/dummy/config/routes.rb +0 -6
  106. data/spec/dummy/config/shakapacker.yml +0 -61
  107. data/spec/dummy/config/spring.rb +0 -6
  108. data/spec/dummy/config/storage.yml +0 -34
  109. data/spec/dummy/config/webpack/ServerClientOrBoth.js +0 -34
  110. data/spec/dummy/config/webpack/clientWebpackConfig.js +0 -15
  111. data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -17
  112. data/spec/dummy/config/webpack/development.js +0 -32
  113. data/spec/dummy/config/webpack/production.js +0 -9
  114. data/spec/dummy/config/webpack/serverWebpackConfig.js +0 -116
  115. data/spec/dummy/config/webpack/test.js +0 -7
  116. data/spec/dummy/config/webpack/webpack.config.js +0 -24
  117. data/spec/dummy/config.ru +0 -5
  118. data/spec/dummy/db/seeds.rb +0 -7
  119. data/spec/dummy/lib/assets/.keep +0 -0
  120. data/spec/dummy/lib/tasks/.keep +0 -0
  121. data/spec/dummy/package.json +0 -44
  122. data/spec/dummy/postcss.config.js +0 -12
  123. data/spec/dummy/public/404.html +0 -67
  124. data/spec/dummy/public/422.html +0 -67
  125. data/spec/dummy/public/500.html +0 -66
  126. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  127. data/spec/dummy/public/apple-touch-icon.png +0 -0
  128. data/spec/dummy/public/favicon.ico +0 -0
  129. data/spec/dummy/public/robots.txt +0 -1
  130. data/spec/dummy/spec/rails_helper.rb +0 -118
  131. data/spec/dummy/spec/spec_helper.rb +0 -96
  132. data/spec/dummy/spec/system/hello_world_spec.rb +0 -19
  133. data/spec/dummy/tsconfig.json +0 -21
  134. data/spec/dummy/vendor/.keep +0 -0
  135. data/spec/dummy/yarn.lock +0 -4696
  136. data/spec/fixtures/beta_package-lock.v1.json +0 -119
  137. data/spec/fixtures/beta_package-lock.v2.json +0 -6777
  138. data/spec/fixtures/beta_package.json +0 -13
  139. data/spec/fixtures/beta_pnpm-lock.v7.yaml +0 -116
  140. data/spec/fixtures/beta_pnpm-lock.v8.yaml +0 -2537
  141. data/spec/fixtures/beta_pnpm-lock.v9.yaml +0 -2885
  142. data/spec/fixtures/beta_yarn.v1.lock +0 -106
  143. data/spec/fixtures/beta_yarn.v2.lock +0 -164
  144. data/spec/fixtures/git_url_package-lock.v1.json +0 -118
  145. data/spec/fixtures/git_url_package-lock.v2.json +0 -10263
  146. data/spec/fixtures/git_url_package.json +0 -13
  147. data/spec/fixtures/git_url_pnpm-lock.v7.yaml +0 -126
  148. data/spec/fixtures/git_url_pnpm-lock.v8.yaml +0 -3728
  149. data/spec/fixtures/git_url_pnpm-lock.v9.yaml +0 -4544
  150. data/spec/fixtures/git_url_yarn.v1.lock +0 -106
  151. data/spec/fixtures/git_url_yarn.v2.lock +0 -165
  152. data/spec/fixtures/github_url_package-lock.v1.json +0 -118
  153. data/spec/fixtures/github_url_package-lock.v2.json +0 -10263
  154. data/spec/fixtures/github_url_package.json +0 -13
  155. data/spec/fixtures/github_url_pnpm-lock.v7.yaml +0 -126
  156. data/spec/fixtures/github_url_pnpm-lock.v8.yaml +0 -3728
  157. data/spec/fixtures/github_url_pnpm-lock.v9.yaml +0 -4544
  158. data/spec/fixtures/github_url_yarn.v1.lock +0 -105
  159. data/spec/fixtures/github_url_yarn.v2.lock +0 -165
  160. data/spec/fixtures/relative_path_package-lock.v1.json +0 -3468
  161. data/spec/fixtures/relative_path_package-lock.v2.json +0 -105
  162. data/spec/fixtures/relative_path_package.json +0 -13
  163. data/spec/fixtures/relative_path_pnpm-lock.v7.yaml +0 -18
  164. data/spec/fixtures/relative_path_pnpm-lock.v8.yaml +0 -22
  165. data/spec/fixtures/relative_path_pnpm-lock.v9.yaml +0 -28
  166. data/spec/fixtures/relative_path_yarn.v1.lock +0 -104
  167. data/spec/fixtures/relative_path_yarn.v2.lock +0 -165
  168. data/spec/fixtures/semver_caret_package-lock.v1.json +0 -119
  169. data/spec/fixtures/semver_caret_package-lock.v2.json +0 -10264
  170. data/spec/fixtures/semver_caret_package.json +0 -13
  171. data/spec/fixtures/semver_caret_pnpm-lock.v7.yaml +0 -117
  172. data/spec/fixtures/semver_caret_pnpm-lock.v8.yaml +0 -2558
  173. data/spec/fixtures/semver_caret_pnpm-lock.v9.yaml +0 -4285
  174. data/spec/fixtures/semver_caret_yarn.v1.lock +0 -106
  175. data/spec/fixtures/semver_caret_yarn.v2.lock +0 -165
  176. data/spec/fixtures/semver_exact_package-lock.v1.json +0 -119
  177. data/spec/fixtures/semver_exact_package-lock.v2.json +0 -6819
  178. data/spec/fixtures/semver_exact_package.json +0 -13
  179. data/spec/fixtures/semver_exact_pnpm-lock.v7.yaml +0 -117
  180. data/spec/fixtures/semver_exact_pnpm-lock.v8.yaml +0 -2558
  181. data/spec/fixtures/semver_exact_pnpm-lock.v9.yaml +0 -2908
  182. data/spec/fixtures/semver_exact_yarn.v1.lock +0 -106
  183. data/spec/fixtures/semver_exact_yarn.v2.lock +0 -165
  184. data/spec/fixtures/semver_tilde_package-lock.v1.json +0 -119
  185. data/spec/fixtures/semver_tilde_package-lock.v2.json +0 -6777
  186. data/spec/fixtures/semver_tilde_package.json +0 -13
  187. data/spec/fixtures/semver_tilde_pnpm-lock.v7.yaml +0 -116
  188. data/spec/fixtures/semver_tilde_pnpm-lock.v8.yaml +0 -2558
  189. data/spec/fixtures/semver_tilde_pnpm-lock.v9.yaml +0 -2885
  190. data/spec/fixtures/semver_tilde_yarn.v1.lock +0 -106
  191. data/spec/fixtures/semver_tilde_yarn.v2.lock +0 -164
  192. data/spec/fixtures/without_package-lock.v1.json +0 -19
  193. data/spec/fixtures/without_package-lock.v2.json +0 -47
  194. data/spec/fixtures/without_package.json +0 -13
  195. data/spec/fixtures/without_pnpm-lock.v7.yaml +0 -23
  196. data/spec/fixtures/without_pnpm-lock.v8.yaml +0 -27
  197. data/spec/fixtures/without_pnpm-lock.v9.yaml +0 -34
  198. data/spec/fixtures/without_yarn.v1.lock +0 -13
  199. data/spec/fixtures/without_yarn.v2.lock +0 -29
  200. data/spec/generator_specs/e2e_template/files/app/controllers/home_controller.rb +0 -4
  201. data/spec/generator_specs/e2e_template/files/app/javascript/components/App.js +0 -12
  202. data/spec/generator_specs/e2e_template/files/app/javascript/packs/application.js +0 -10
  203. data/spec/generator_specs/e2e_template/files/app/views/home/index.html.erb +0 -2
  204. data/spec/generator_specs/e2e_template/files/app/views/layouts/application.html.erb +0 -17
  205. data/spec/generator_specs/e2e_template/files/config/routes.rb +0 -3
  206. data/spec/generator_specs/e2e_template/files/spec/system/test_react_component_renders_spec.rb +0 -13
  207. data/spec/generator_specs/e2e_template/template.rb +0 -29
  208. data/spec/generator_specs/fake-bin/bun +0 -10
  209. data/spec/generator_specs/fake-bin/npm +0 -10
  210. data/spec/generator_specs/fake-bin/pnpm +0 -10
  211. data/spec/generator_specs/fake-bin/yarn +0 -10
  212. data/spec/generator_specs/generator_spec.rb +0 -193
  213. data/spec/mounted_app/Rakefile +0 -4
  214. data/spec/mounted_app/package.json +0 -1
  215. data/spec/mounted_app/test/dummy/Rakefile +0 -3
  216. data/spec/mounted_app/test/dummy/bin/rails +0 -3
  217. data/spec/mounted_app/test/dummy/bin/rake +0 -3
  218. data/spec/mounted_app/test/dummy/config/application.rb +0 -10
  219. data/spec/mounted_app/test/dummy/config/environment.rb +0 -3
  220. data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -81
  221. data/spec/mounted_app/test/dummy/config.ru +0 -5
  222. data/spec/mounted_app/test/dummy/package.json +0 -7
  223. data/spec/shakapacker/command_spec.rb +0 -134
  224. data/spec/shakapacker/compiler_spec.rb +0 -57
  225. data/spec/shakapacker/compiler_strategy_spec.rb +0 -24
  226. data/spec/shakapacker/configuration_spec.rb +0 -377
  227. data/spec/shakapacker/dev_server_runner_spec.rb +0 -136
  228. data/spec/shakapacker/dev_server_spec.rb +0 -118
  229. data/spec/shakapacker/digest_strategy_spec.rb +0 -59
  230. data/spec/shakapacker/engine_rake_tasks_spec.rb +0 -50
  231. data/spec/shakapacker/env_spec.rb +0 -23
  232. data/spec/shakapacker/helper_spec.rb +0 -243
  233. data/spec/shakapacker/instance_spec.rb +0 -29
  234. data/spec/shakapacker/manifest_spec.rb +0 -100
  235. data/spec/shakapacker/mtime_strategy_spec.rb +0 -55
  236. data/spec/shakapacker/rake_tasks_spec.rb +0 -85
  237. data/spec/shakapacker/shakapacker_spec.rb +0 -40
  238. data/spec/shakapacker/spec_helper_initializer.rb +0 -24
  239. data/spec/shakapacker/test_app/.gitignore +0 -2
  240. data/spec/shakapacker/test_app/Rakefile +0 -3
  241. data/spec/shakapacker/test_app/app/javascript/entrypoints/application.js +0 -10
  242. data/spec/shakapacker/test_app/app/javascript/entrypoints/generated/something.js +0 -2
  243. data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.css +0 -4
  244. data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.js +0 -4
  245. data/spec/shakapacker/test_app/bin/shakapacker +0 -14
  246. data/spec/shakapacker/test_app/bin/shakapacker-dev-server +0 -14
  247. data/spec/shakapacker/test_app/config/application.rb +0 -11
  248. data/spec/shakapacker/test_app/config/environment.rb +0 -4
  249. data/spec/shakapacker/test_app/config/initializers/inspect_autoload_paths.rb +0 -1
  250. data/spec/shakapacker/test_app/config/shakapacker.yml +0 -82
  251. data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -83
  252. data/spec/shakapacker/test_app/config/shakapacker_defaults_fallback.yml +0 -11
  253. data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -79
  254. data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -82
  255. data/spec/shakapacker/test_app/config/shakapacker_no_precompile.yml +0 -7
  256. data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -84
  257. data/spec/shakapacker/test_app/config/shakapacker_public_root.yml +0 -18
  258. data/spec/shakapacker/test_app/config/webpack/webpack.config.js +0 -0
  259. data/spec/shakapacker/test_app/config.ru +0 -5
  260. data/spec/shakapacker/test_app/package.json +0 -14
  261. data/spec/shakapacker/test_app/public/packs/manifest.json +0 -58
  262. data/spec/shakapacker/test_app/some.config.js +0 -0
  263. data/spec/shakapacker/test_app/yarn.lock +0 -11
  264. data/spec/shakapacker/utils_manager_spec.rb +0 -125
  265. data/spec/shakapacker/version_checker_spec.rb +0 -1469
  266. data/spec/shakapacker/webpack_runner_spec.rb +0 -76
  267. data/spec/spec_helper.rb +0 -100
  268. data/spec/support/package_json_helpers.rb +0 -19
@@ -1 +0,0 @@
1
- defaults
@@ -1,20 +0,0 @@
1
- # Ignore the default SQLite database.
2
- /db/*.sqlite3
3
- /db/*.sqlite3-journal
4
- /db/*.sqlite3-*
5
-
6
- # Ignore all logfiles and tempfiles.
7
- /log
8
- /tmp
9
-
10
- /storage
11
-
12
- /public/assets
13
- .byebug_history
14
-
15
- # Ignore master key for decrypting credentials and more.
16
- /config/master.key
17
-
18
- /public/packs
19
- /public/packs-test
20
- /node_modules
@@ -1,4 +0,0 @@
1
- trailingComma: none
2
- tabWidth: 2
3
- semi: false
4
- singleQuote: true
data/spec/dummy/Gemfile DELETED
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
-
6
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
- gem "rails", "~> 6.1"
8
- # Use sqlite3 as the database for Active Record
9
- gem "sqlite3", "~> 1.4"
10
- # Use Puma as the app server
11
- gem "puma", "~> 4.1"
12
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
13
- gem "jbuilder", "~> 2.7"
14
- # Use Redis adapter to run Action Cable in production
15
- # gem 'redis', '~> 4.0'
16
- # Use Active Model has_secure_password
17
- # gem 'bcrypt', '~> 3.1.7'
18
-
19
- # Use Active Storage variant
20
- # gem 'image_processing', '~> 1.2'
21
-
22
- # Reduces boot times through caching; required in config/boot.rb
23
- gem "bootsnap", ">= 1.4.2", require: false
24
-
25
- group :development, :test, :production do
26
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
27
- gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
28
- end
29
-
30
- group :development, :test do
31
- gem "rspec-rails", "~> 6.0.0"
32
- end
33
-
34
- group :development do
35
- # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
36
- gem "web-console", ">= 3.3.0"
37
- gem "listen", "~> 3.2"
38
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
39
- gem "spring"
40
- gem "spring-watcher-listen", "~> 2.0.0"
41
- end
42
-
43
- group :test do
44
- # Adds support for Capybara system testing and selenium driver
45
- # There is an important fix in 3.39.1.
46
- gem "capybara", "~> 3.39.1"
47
- # gem 'capybara-webkit'
48
- gem "selenium-webdriver", ">= 4.9"
49
- end
50
-
51
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
52
- gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
53
-
54
- gem "shakapacker", path: "../.."
55
- gem "react_on_rails", "13.3.3"
56
-
57
- gem "net-smtp", "~> 0.3.3"
58
-
59
- # Psych 4+ comes with breakibg changes in Ruby 3.1.0. Though the issue are
60
- # addressed in Rails 7. So remove this the next line in Rails 7.
61
- gem "psych", "< 4"
@@ -1,5 +0,0 @@
1
- # Procfile for development using HMR
2
- # You can run these commands in separate shells
3
- rails: bundle exec rails s -p 3000
4
- wp-client: bin/shakapacker-dev-server
5
- wp-server: SERVER_BUNDLE_ONLY=yes bin/shakapacker --watch
@@ -1,9 +0,0 @@
1
- # You can run these commands in separate shells
2
- web: rails s -p 3000
3
-
4
- # Next line runs a watch process with webpack to compile the changed files.
5
- # When making frequent changes to client side assets, you will prefer building webpack assets
6
- # upon saving rather than when you refresh your browser page.
7
- # Note, if using React on Rails localization you will need to run
8
- # `bundle exec rake react_on_rails:locale` before you run bin/shakapacker
9
- webpack: sh -c 'rm -rf public/packs/* || true && bin/shakapacker -w'
data/spec/dummy/README.md DELETED
@@ -1 +0,0 @@
1
- This dummy project is based on [React on Rails Demo With SSR, HMR fast refresh, and TypeScript](https://github.com/shakacode/react_on_rails_demo_ssr_hmr) project.
data/spec/dummy/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative "config/application"
5
-
6
- Rails.application.load_tasks
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
File without changes
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
- * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
File without changes
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class HelloWorldController < ApplicationController
4
- layout "hello_world"
5
-
6
- def index
7
- @hello_world_props = { name: "Stranger" }
8
- end
9
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,3 +0,0 @@
1
- declare module "*.module.css";
2
- declare module "*.module.scss";
3
- declare module "*.svg";
@@ -1,25 +0,0 @@
1
- .bright {
2
- color: green;
3
- font-weight: bold;
4
- }
5
-
6
- .logo {
7
- height: 10vmin;
8
- pointer-events: none;
9
- }
10
-
11
-
12
- @media (prefers-reduced-motion: no-preference) {
13
- .logo {
14
- animation: logo-spin infinite 20s linear;
15
- }
16
- }
17
-
18
- @keyframes logo-spin {
19
- from {
20
- transform: rotate(0deg);
21
- }
22
- to {
23
- transform: rotate(360deg);
24
- }
25
- }
@@ -1,47 +0,0 @@
1
- import * as React from 'react'
2
- import { useState, useEffect } from 'react'
3
- import type { FunctionComponent } from 'react'
4
-
5
- import style from './HelloWorld.module.css'
6
- import logo from './logo.svg'
7
-
8
- export interface Props {
9
- readonly name: string
10
- }
11
-
12
- // Note, you need to declare the `FunctionComponent` type so that it complies
13
- // with `ReactOnRails.register` type.
14
- const HelloWorld: FunctionComponent<Props> = (props: Props) => {
15
- const [name, setName] = useState(props.name)
16
-
17
- useEffect(() => {
18
- console.log(
19
- '%c%s%c%s',
20
- 'color: green; background-color: lightgreen; font-weight: bold;',
21
- 'ShakaCode is hiring!',
22
- 'color: green; background-color: lightgreen; font-weight: normal;',
23
- 'Check out our open positions: https://www.shakacode.com/career/',
24
- );
25
- }, [])
26
-
27
- return (
28
- <>
29
- <img src={logo} className={style.logo} alt="logo" />
30
- <h3>Hello, {name || 'World'}!</h3>
31
- <hr />
32
- <form>
33
- <label className={style.bright} htmlFor="name">
34
- Say hello to:{' '}
35
- <input
36
- id="name"
37
- type="text"
38
- value={name}
39
- onChange={(e) => setName(e.target.value)}
40
- />
41
- </label>
42
- </form>
43
- </>
44
- )
45
- }
46
-
47
- export default HelloWorld
@@ -1,5 +0,0 @@
1
- import HelloWorld from './HelloWorld'
2
- // This could be specialized for server rendering
3
- // For example, if using React-Router, we'd have the SSR setup here.
4
-
5
- export default HelloWorld
@@ -1,7 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
2
- <g fill="#61DAFB">
3
- <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
4
- <circle cx="420.9" cy="296.5" r="45.7"/>
5
- <path d="M520.5 78.1z"/>
6
- </g>
7
- </svg>
@@ -1,17 +0,0 @@
1
- /* eslint no-console:0 */
2
- // This file is automatically compiled by Webpack, along with any other files
3
- // present in this directory. You're encouraged to place your actual application logic in
4
- // a relevant structure within app/javascript and only use these pack files to reference
5
- // that code so it'll be compiled.
6
- //
7
- // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
8
- // layout file, like app/views/layouts/application.html.erb
9
-
10
- // Uncomment to copy all static images under ../images to the output folder and reference
11
- // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
12
- // or the `imagePath` JavaScript helper below.
13
- //
14
- // const images = require.context('../images', true)
15
- // const imagePath = (name) => images(name, true)
16
-
17
- console.log('Hello World from Shakapacker')
@@ -1,8 +0,0 @@
1
- import ReactOnRails from 'react-on-rails'
2
-
3
- import HelloWorld from '../bundles/HelloWorld/components/HelloWorld'
4
-
5
- // This is how react_on_rails can see the HelloWorld in the browser.
6
- ReactOnRails.register({
7
- HelloWorld
8
- })
@@ -1,8 +0,0 @@
1
- import ReactOnRails from 'react-on-rails'
2
-
3
- import HelloWorld from '../bundles/HelloWorld/components/HelloWorldServer'
4
-
5
- // This is how react_on_rails can see the HelloWorld in the browser.
6
- ReactOnRails.register({
7
- HelloWorld
8
- })
@@ -1,7 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- # Automatically retry jobs that encountered a deadlock
3
- # retry_on ActiveRecord::Deadlocked
4
-
5
- # Most jobs are safe to ignore if the underlying records are no longer available
6
- # discard_on ActiveJob::DeserializationError
7
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: "from@example.com"
3
- layout "mailer"
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
File without changes
@@ -1,2 +0,0 @@
1
- <h1>Hello, World!</h1>
2
- <%= react_component("HelloWorld", props: @hello_world_props, prerender: true) %>
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>TestReactOnRailsV12SsrV2</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag 'application', media: 'all' %>
9
- </head>
10
-
11
- <body>
12
- <%= yield %>
13
- </body>
14
- </html>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>ReactOnRailsWithShakapacker</title>
5
- <%= csrf_meta_tags %>
6
- <%= javascript_pack_tag 'hello-world-bundle' %>
7
- <%= stylesheet_pack_tag 'hello-world-bundle' %>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1,30 +0,0 @@
1
- module.exports = function (api) {
2
- const defaultConfigFunc = require('shakapacker/package/babel/preset.js')
3
- const resultConfig = defaultConfigFunc(api)
4
- const isProductionEnv = api.env('production')
5
-
6
- const changesOnDefault = {
7
- presets: [
8
- [
9
- '@babel/preset-react',
10
- {
11
- development: !isProductionEnv,
12
- useBuiltIns: true
13
- }
14
- ]
15
- ].filter(Boolean),
16
- plugins: [
17
- process.env.WEBPACK_SERVE && 'react-refresh/babel',
18
- isProductionEnv && ['babel-plugin-transform-react-remove-prop-types',
19
- {
20
- removeImport: true
21
- }
22
- ]
23
- ].filter(Boolean),
24
- }
25
-
26
- resultConfig.presets = [...resultConfig.presets, ...changesOnDefault.presets]
27
- resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins ]
28
-
29
- return resultConfig
30
- }
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'bundle' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "rubygems"
12
-
13
- m = Module.new do
14
- module_function
15
-
16
- def invoked_as_script?
17
- File.expand_path($0) == File.expand_path(__FILE__)
18
- end
19
-
20
- def env_var_version
21
- ENV["BUNDLER_VERSION"]
22
- end
23
-
24
- def cli_arg_version
25
- return unless invoked_as_script? # don't want to hijack other binstubs
26
- return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
- bundler_version = nil
28
- update_index = nil
29
- ARGV.each_with_index do |a, i|
30
- if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
- bundler_version = a
32
- end
33
- next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
- bundler_version = $1
35
- update_index = i
36
- end
37
- bundler_version
38
- end
39
-
40
- def gemfile
41
- gemfile = ENV["BUNDLE_GEMFILE"]
42
- return gemfile if gemfile && !gemfile.empty?
43
-
44
- File.expand_path("../../Gemfile", __FILE__)
45
- end
46
-
47
- def lockfile
48
- lockfile =
49
- case File.basename(gemfile)
50
- when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51
- else "#{gemfile}.lock"
52
- end
53
- File.expand_path(lockfile)
54
- end
55
-
56
- def lockfile_version
57
- return unless File.file?(lockfile)
58
- lockfile_contents = File.read(lockfile)
59
- return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
- Regexp.last_match(1)
61
- end
62
-
63
- def bundler_requirement
64
- @bundler_requirement ||=
65
- env_var_version || cli_arg_version ||
66
- bundler_requirement_for(lockfile_version)
67
- end
68
-
69
- def bundler_requirement_for(version)
70
- return "#{Gem::Requirement.default}.a" unless version
71
-
72
- bundler_gem_version = Gem::Version.new(version)
73
-
74
- requirement = bundler_gem_version.approximate_recommendation
75
-
76
- return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
77
-
78
- requirement += ".a" if bundler_gem_version.prerelease?
79
-
80
- requirement
81
- end
82
-
83
- def load_bundler!
84
- ENV["BUNDLE_GEMFILE"] ||= gemfile
85
-
86
- activate_bundler
87
- end
88
-
89
- def activate_bundler
90
- gem_error = activation_error_handling do
91
- gem "bundler", bundler_requirement
92
- end
93
- return if gem_error.nil?
94
- require_error = activation_error_handling do
95
- require "bundler/version"
96
- end
97
- return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98
- warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99
- exit 42
100
- end
101
-
102
- def activation_error_handling
103
- yield
104
- nil
105
- rescue StandardError, LoadError => e
106
- e
107
- end
108
- end
109
-
110
- m.load_bundler!
111
-
112
- if m.invoked_as_script?
113
- load Gem.bin_path("bundler", "bundle")
114
- end
data/spec/dummy/bin/dev DELETED
@@ -1,30 +0,0 @@
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
@@ -1,30 +0,0 @@
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
data/spec/dummy/bin/rails DELETED
@@ -1,9 +0,0 @@
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"
data/spec/dummy/bin/rake DELETED
@@ -1,9 +0,0 @@
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
data/spec/dummy/bin/setup DELETED
@@ -1,33 +0,0 @@
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