shakapacker 8.0.0 → 8.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) 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 +21 -12
  9. data/Gemfile.lock +257 -0
  10. data/README.md +11 -12
  11. data/docs/customizing_babel_config.md +32 -4
  12. data/docs/react.md +3 -2
  13. data/docs/troubleshooting.md +1 -1
  14. data/docs/v8_upgrade.md +2 -2
  15. data/lib/shakapacker/version.rb +1 -1
  16. data/package.json +2 -2
  17. data/shakapacker.gemspec +5 -2
  18. metadata +5 -235
  19. data/lib/install/bin/yarn +0 -18
  20. data/rakelib/release.rake +0 -65
  21. data/spec/dummy/.browserslistrc +0 -1
  22. data/spec/dummy/.gitignore +0 -20
  23. data/spec/dummy/.prettierrc.yaml +0 -4
  24. data/spec/dummy/Gemfile +0 -61
  25. data/spec/dummy/Procfile.dev +0 -5
  26. data/spec/dummy/Procfile.dev-static +0 -9
  27. data/spec/dummy/README.md +0 -1
  28. data/spec/dummy/Rakefile +0 -6
  29. data/spec/dummy/app/assets/config/manifest.js +0 -2
  30. data/spec/dummy/app/assets/images/.keep +0 -0
  31. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  32. data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
  33. data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
  34. data/spec/dummy/app/controllers/application_controller.rb +0 -2
  35. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  36. data/spec/dummy/app/controllers/hello_world_controller.rb +0 -9
  37. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  38. data/spec/dummy/app/javascript/Globals.d.ts +0 -3
  39. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +0 -25
  40. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.tsx +0 -47
  41. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorldServer.tsx +0 -5
  42. data/spec/dummy/app/javascript/bundles/HelloWorld/components/logo.svg +0 -7
  43. data/spec/dummy/app/javascript/packs/application.js +0 -17
  44. data/spec/dummy/app/javascript/packs/hello-world-bundle.ts +0 -8
  45. data/spec/dummy/app/javascript/packs/server-bundle.ts +0 -8
  46. data/spec/dummy/app/jobs/application_job.rb +0 -7
  47. data/spec/dummy/app/mailers/application_mailer.rb +0 -4
  48. data/spec/dummy/app/models/application_record.rb +0 -3
  49. data/spec/dummy/app/models/concerns/.keep +0 -0
  50. data/spec/dummy/app/views/hello_world/index.html.erb +0 -2
  51. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  52. data/spec/dummy/app/views/layouts/hello_world.html.erb +0 -13
  53. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  54. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  55. data/spec/dummy/babel.config.js +0 -30
  56. data/spec/dummy/bin/bundle +0 -114
  57. data/spec/dummy/bin/dev +0 -30
  58. data/spec/dummy/bin/dev-static +0 -30
  59. data/spec/dummy/bin/rails +0 -9
  60. data/spec/dummy/bin/rake +0 -9
  61. data/spec/dummy/bin/setup +0 -33
  62. data/spec/dummy/bin/shakapacker +0 -13
  63. data/spec/dummy/bin/shakapacker-dev-server +0 -13
  64. data/spec/dummy/bin/spring +0 -17
  65. data/spec/dummy/bin/yarn +0 -18
  66. data/spec/dummy/config/application.rb +0 -35
  67. data/spec/dummy/config/boot.rb +0 -4
  68. data/spec/dummy/config/cable.yml +0 -10
  69. data/spec/dummy/config/credentials.yml.enc +0 -1
  70. data/spec/dummy/config/database.yml +0 -25
  71. data/spec/dummy/config/environment.rb +0 -5
  72. data/spec/dummy/config/environments/development.rb +0 -54
  73. data/spec/dummy/config/environments/production.rb +0 -106
  74. data/spec/dummy/config/environments/test.rb +0 -49
  75. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
  76. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  77. data/spec/dummy/config/initializers/content_security_policy.rb +0 -28
  78. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
  79. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  80. data/spec/dummy/config/initializers/inflections.rb +0 -16
  81. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  82. data/spec/dummy/config/initializers/react_on_rails.rb +0 -58
  83. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  84. data/spec/dummy/config/locales/en.yml +0 -33
  85. data/spec/dummy/config/puma.rb +0 -38
  86. data/spec/dummy/config/routes.rb +0 -6
  87. data/spec/dummy/config/shakapacker.yml +0 -61
  88. data/spec/dummy/config/spring.rb +0 -6
  89. data/spec/dummy/config/storage.yml +0 -34
  90. data/spec/dummy/config/webpack/ServerClientOrBoth.js +0 -34
  91. data/spec/dummy/config/webpack/clientWebpackConfig.js +0 -15
  92. data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -17
  93. data/spec/dummy/config/webpack/development.js +0 -32
  94. data/spec/dummy/config/webpack/production.js +0 -9
  95. data/spec/dummy/config/webpack/serverWebpackConfig.js +0 -116
  96. data/spec/dummy/config/webpack/test.js +0 -7
  97. data/spec/dummy/config/webpack/webpack.config.js +0 -24
  98. data/spec/dummy/config.ru +0 -5
  99. data/spec/dummy/db/seeds.rb +0 -7
  100. data/spec/dummy/lib/assets/.keep +0 -0
  101. data/spec/dummy/lib/tasks/.keep +0 -0
  102. data/spec/dummy/package.json +0 -44
  103. data/spec/dummy/postcss.config.js +0 -12
  104. data/spec/dummy/public/404.html +0 -67
  105. data/spec/dummy/public/422.html +0 -67
  106. data/spec/dummy/public/500.html +0 -66
  107. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  108. data/spec/dummy/public/apple-touch-icon.png +0 -0
  109. data/spec/dummy/public/favicon.ico +0 -0
  110. data/spec/dummy/public/robots.txt +0 -1
  111. data/spec/dummy/spec/rails_helper.rb +0 -118
  112. data/spec/dummy/spec/spec_helper.rb +0 -96
  113. data/spec/dummy/spec/system/hello_world_spec.rb +0 -19
  114. data/spec/dummy/tsconfig.json +0 -21
  115. data/spec/dummy/vendor/.keep +0 -0
  116. data/spec/dummy/yarn.lock +0 -4696
  117. data/spec/fixtures/beta_package-lock.v1.json +0 -119
  118. data/spec/fixtures/beta_package-lock.v2.json +0 -6777
  119. data/spec/fixtures/beta_package.json +0 -13
  120. data/spec/fixtures/beta_pnpm-lock.v7.yaml +0 -116
  121. data/spec/fixtures/beta_pnpm-lock.v8.yaml +0 -2537
  122. data/spec/fixtures/beta_pnpm-lock.v9.yaml +0 -2885
  123. data/spec/fixtures/beta_yarn.v1.lock +0 -106
  124. data/spec/fixtures/beta_yarn.v2.lock +0 -164
  125. data/spec/fixtures/git_url_package-lock.v1.json +0 -118
  126. data/spec/fixtures/git_url_package-lock.v2.json +0 -10263
  127. data/spec/fixtures/git_url_package.json +0 -13
  128. data/spec/fixtures/git_url_pnpm-lock.v7.yaml +0 -126
  129. data/spec/fixtures/git_url_pnpm-lock.v8.yaml +0 -3728
  130. data/spec/fixtures/git_url_pnpm-lock.v9.yaml +0 -4544
  131. data/spec/fixtures/git_url_yarn.v1.lock +0 -106
  132. data/spec/fixtures/git_url_yarn.v2.lock +0 -165
  133. data/spec/fixtures/github_url_package-lock.v1.json +0 -118
  134. data/spec/fixtures/github_url_package-lock.v2.json +0 -10263
  135. data/spec/fixtures/github_url_package.json +0 -13
  136. data/spec/fixtures/github_url_pnpm-lock.v7.yaml +0 -126
  137. data/spec/fixtures/github_url_pnpm-lock.v8.yaml +0 -3728
  138. data/spec/fixtures/github_url_pnpm-lock.v9.yaml +0 -4544
  139. data/spec/fixtures/github_url_yarn.v1.lock +0 -105
  140. data/spec/fixtures/github_url_yarn.v2.lock +0 -165
  141. data/spec/fixtures/relative_path_package-lock.v1.json +0 -3468
  142. data/spec/fixtures/relative_path_package-lock.v2.json +0 -105
  143. data/spec/fixtures/relative_path_package.json +0 -13
  144. data/spec/fixtures/relative_path_pnpm-lock.v7.yaml +0 -18
  145. data/spec/fixtures/relative_path_pnpm-lock.v8.yaml +0 -22
  146. data/spec/fixtures/relative_path_pnpm-lock.v9.yaml +0 -28
  147. data/spec/fixtures/relative_path_yarn.v1.lock +0 -104
  148. data/spec/fixtures/relative_path_yarn.v2.lock +0 -165
  149. data/spec/fixtures/semver_caret_package-lock.v1.json +0 -119
  150. data/spec/fixtures/semver_caret_package-lock.v2.json +0 -10264
  151. data/spec/fixtures/semver_caret_package.json +0 -13
  152. data/spec/fixtures/semver_caret_pnpm-lock.v7.yaml +0 -117
  153. data/spec/fixtures/semver_caret_pnpm-lock.v8.yaml +0 -2558
  154. data/spec/fixtures/semver_caret_pnpm-lock.v9.yaml +0 -4285
  155. data/spec/fixtures/semver_caret_yarn.v1.lock +0 -106
  156. data/spec/fixtures/semver_caret_yarn.v2.lock +0 -165
  157. data/spec/fixtures/semver_exact_package-lock.v1.json +0 -119
  158. data/spec/fixtures/semver_exact_package-lock.v2.json +0 -6819
  159. data/spec/fixtures/semver_exact_package.json +0 -13
  160. data/spec/fixtures/semver_exact_pnpm-lock.v7.yaml +0 -117
  161. data/spec/fixtures/semver_exact_pnpm-lock.v8.yaml +0 -2558
  162. data/spec/fixtures/semver_exact_pnpm-lock.v9.yaml +0 -2908
  163. data/spec/fixtures/semver_exact_yarn.v1.lock +0 -106
  164. data/spec/fixtures/semver_exact_yarn.v2.lock +0 -165
  165. data/spec/fixtures/semver_tilde_package-lock.v1.json +0 -119
  166. data/spec/fixtures/semver_tilde_package-lock.v2.json +0 -6777
  167. data/spec/fixtures/semver_tilde_package.json +0 -13
  168. data/spec/fixtures/semver_tilde_pnpm-lock.v7.yaml +0 -116
  169. data/spec/fixtures/semver_tilde_pnpm-lock.v8.yaml +0 -2558
  170. data/spec/fixtures/semver_tilde_pnpm-lock.v9.yaml +0 -2885
  171. data/spec/fixtures/semver_tilde_yarn.v1.lock +0 -106
  172. data/spec/fixtures/semver_tilde_yarn.v2.lock +0 -164
  173. data/spec/fixtures/without_package-lock.v1.json +0 -19
  174. data/spec/fixtures/without_package-lock.v2.json +0 -47
  175. data/spec/fixtures/without_package.json +0 -13
  176. data/spec/fixtures/without_pnpm-lock.v7.yaml +0 -23
  177. data/spec/fixtures/without_pnpm-lock.v8.yaml +0 -27
  178. data/spec/fixtures/without_pnpm-lock.v9.yaml +0 -34
  179. data/spec/fixtures/without_yarn.v1.lock +0 -13
  180. data/spec/fixtures/without_yarn.v2.lock +0 -29
  181. data/spec/generator_specs/e2e_template/files/app/controllers/home_controller.rb +0 -4
  182. data/spec/generator_specs/e2e_template/files/app/javascript/components/App.js +0 -12
  183. data/spec/generator_specs/e2e_template/files/app/javascript/packs/application.js +0 -10
  184. data/spec/generator_specs/e2e_template/files/app/views/home/index.html.erb +0 -2
  185. data/spec/generator_specs/e2e_template/files/app/views/layouts/application.html.erb +0 -17
  186. data/spec/generator_specs/e2e_template/files/config/routes.rb +0 -3
  187. data/spec/generator_specs/e2e_template/files/spec/system/test_react_component_renders_spec.rb +0 -13
  188. data/spec/generator_specs/e2e_template/template.rb +0 -29
  189. data/spec/generator_specs/fake-bin/bun +0 -10
  190. data/spec/generator_specs/fake-bin/npm +0 -10
  191. data/spec/generator_specs/fake-bin/pnpm +0 -10
  192. data/spec/generator_specs/fake-bin/yarn +0 -10
  193. data/spec/generator_specs/generator_spec.rb +0 -193
  194. data/spec/mounted_app/Rakefile +0 -4
  195. data/spec/mounted_app/package.json +0 -1
  196. data/spec/mounted_app/test/dummy/Rakefile +0 -3
  197. data/spec/mounted_app/test/dummy/bin/rails +0 -3
  198. data/spec/mounted_app/test/dummy/bin/rake +0 -3
  199. data/spec/mounted_app/test/dummy/config/application.rb +0 -10
  200. data/spec/mounted_app/test/dummy/config/environment.rb +0 -3
  201. data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -81
  202. data/spec/mounted_app/test/dummy/config.ru +0 -5
  203. data/spec/mounted_app/test/dummy/package.json +0 -7
  204. data/spec/shakapacker/command_spec.rb +0 -134
  205. data/spec/shakapacker/compiler_spec.rb +0 -57
  206. data/spec/shakapacker/compiler_strategy_spec.rb +0 -24
  207. data/spec/shakapacker/configuration_spec.rb +0 -377
  208. data/spec/shakapacker/dev_server_runner_spec.rb +0 -136
  209. data/spec/shakapacker/dev_server_spec.rb +0 -118
  210. data/spec/shakapacker/digest_strategy_spec.rb +0 -59
  211. data/spec/shakapacker/engine_rake_tasks_spec.rb +0 -50
  212. data/spec/shakapacker/env_spec.rb +0 -23
  213. data/spec/shakapacker/helper_spec.rb +0 -243
  214. data/spec/shakapacker/instance_spec.rb +0 -29
  215. data/spec/shakapacker/manifest_spec.rb +0 -100
  216. data/spec/shakapacker/mtime_strategy_spec.rb +0 -55
  217. data/spec/shakapacker/rake_tasks_spec.rb +0 -85
  218. data/spec/shakapacker/shakapacker_spec.rb +0 -40
  219. data/spec/shakapacker/spec_helper_initializer.rb +0 -24
  220. data/spec/shakapacker/test_app/.gitignore +0 -2
  221. data/spec/shakapacker/test_app/Rakefile +0 -3
  222. data/spec/shakapacker/test_app/app/javascript/entrypoints/application.js +0 -10
  223. data/spec/shakapacker/test_app/app/javascript/entrypoints/generated/something.js +0 -2
  224. data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.css +0 -4
  225. data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.js +0 -4
  226. data/spec/shakapacker/test_app/bin/shakapacker +0 -14
  227. data/spec/shakapacker/test_app/bin/shakapacker-dev-server +0 -14
  228. data/spec/shakapacker/test_app/config/application.rb +0 -11
  229. data/spec/shakapacker/test_app/config/environment.rb +0 -4
  230. data/spec/shakapacker/test_app/config/initializers/inspect_autoload_paths.rb +0 -1
  231. data/spec/shakapacker/test_app/config/shakapacker.yml +0 -82
  232. data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -83
  233. data/spec/shakapacker/test_app/config/shakapacker_defaults_fallback.yml +0 -11
  234. data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -79
  235. data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -82
  236. data/spec/shakapacker/test_app/config/shakapacker_no_precompile.yml +0 -7
  237. data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -84
  238. data/spec/shakapacker/test_app/config/shakapacker_public_root.yml +0 -18
  239. data/spec/shakapacker/test_app/config/webpack/webpack.config.js +0 -0
  240. data/spec/shakapacker/test_app/config.ru +0 -5
  241. data/spec/shakapacker/test_app/package.json +0 -14
  242. data/spec/shakapacker/test_app/public/packs/manifest.json +0 -58
  243. data/spec/shakapacker/test_app/some.config.js +0 -0
  244. data/spec/shakapacker/test_app/yarn.lock +0 -11
  245. data/spec/shakapacker/utils_manager_spec.rb +0 -125
  246. data/spec/shakapacker/version_checker_spec.rb +0 -1469
  247. data/spec/shakapacker/webpack_runner_spec.rb +0 -76
  248. data/spec/spec_helper.rb +0 -100
  249. data/spec/support/package_json_helpers.rb +0 -19
@@ -1,116 +0,0 @@
1
- const { merge, config } = require('shakapacker')
2
- const commonWebpackConfig = require('./commonWebpackConfig')
3
-
4
- const webpack = require('webpack')
5
-
6
- const configureServer = () => {
7
- // We need to use "merge" because the clientConfigObject, EVEN after running
8
- // toWebpackConfig() is a mutable GLOBAL. Thus any changes, like modifying the
9
- // entry value will result in changing the client config!
10
- // Using webpack-merge into an empty object avoids this issue.
11
- const serverWebpackConfig = commonWebpackConfig()
12
-
13
- // We just want the single server bundle entry
14
- const serverEntry = {
15
- 'server-bundle': serverWebpackConfig.entry['server-bundle']
16
- }
17
-
18
- if (!serverEntry['server-bundle']) {
19
- throw new Error('Create a pack with the file name \'server-bundle.js\' containing all the server rendering files')
20
- }
21
-
22
- serverWebpackConfig.entry = serverEntry
23
-
24
- // Remove the mini-css-extract-plugin from the style loaders because
25
- // the client build will handle exporting CSS.
26
- // replace file-loader with null-loader
27
- serverWebpackConfig.module.rules.forEach((loader) => {
28
- if (loader.use && loader.use.filter) {
29
- loader.use = loader.use.filter(
30
- (item) =>
31
- !(typeof item === 'string' && item.match(/mini-css-extract-plugin/))
32
- )
33
- }
34
- })
35
-
36
- // No splitting of chunks for a server bundle
37
- serverWebpackConfig.optimization = {
38
- minimize: false
39
- }
40
- serverWebpackConfig.plugins.unshift(
41
- new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })
42
- )
43
-
44
- // Custom output for the server-bundle that matches the config in
45
- // config/initializers/react_on_rails.rb
46
- serverWebpackConfig.output = {
47
- filename: 'server-bundle.js',
48
- globalObject: 'this',
49
- // If using the React on Rails Pro node server renderer, uncomment the next line
50
- // libraryTarget: 'commonjs2',
51
- path: config.outputPath,
52
- publicPath: config.publicPath,
53
- // https://webpack.js.org/configuration/output/#outputglobalobject
54
- }
55
-
56
- // Don't hash the server bundle b/c would conflict with the client manifest
57
- // And no need for the MiniCssExtractPlugin
58
- serverWebpackConfig.plugins = serverWebpackConfig.plugins.filter(
59
- (plugin) =>
60
- plugin.constructor.name !== 'WebpackAssetsManifest' &&
61
- plugin.constructor.name !== 'MiniCssExtractPlugin' &&
62
- plugin.constructor.name !== 'ForkTsCheckerWebpackPlugin'
63
- )
64
-
65
- // Configure loader rules for SSR
66
- // Remove the mini-css-extract-plugin from the style loaders because
67
- // the client build will handle exporting CSS.
68
- // replace file-loader with null-loader
69
- const rules = serverWebpackConfig.module.rules;
70
- rules.forEach((rule) => {
71
- if (Array.isArray(rule.use)) {
72
- // remove the mini-css-extract-plugin and style-loader
73
- rule.use = rule.use.filter((item) => {
74
- let testValue;
75
- if (typeof item === 'string') {
76
- testValue = item;
77
- } else if (typeof item.loader === 'string') {
78
- testValue = item.loader;
79
- }
80
- return !(testValue.match(/mini-css-extract-plugin/) || testValue === 'style-loader');
81
- });
82
- const cssLoader = rule.use.find((item) => {
83
- let testValue;
84
-
85
- if (typeof item === 'string') {
86
- testValue = item;
87
- } else if (typeof item.loader === 'string') {
88
- testValue = item.loader;
89
- }
90
-
91
- return testValue.includes('css-loader');
92
- });
93
- if (cssLoader && cssLoader.options) {
94
- cssLoader.options.modules = { exportOnlyLocals: true };
95
- }
96
-
97
- // Skip writing image files during SSR by setting emitFile to false
98
- } else if (rule.use && (rule.use.loader === 'url-loader' || rule.use.loader === 'file-loader')) {
99
- rule.use.options.emitFile = false;
100
- }
101
- });
102
-
103
- // eval works well for the SSR bundle because it's the fastest and shows
104
- // lines in the server bundle which is good for debugging SSR
105
- // The default of cheap-module-source-map is slow and provides poor info.
106
- serverWebpackConfig.devtool = 'eval'
107
-
108
- // If using the default 'web', then libraries like Emotion and loadable-components
109
- // break with SSR. The fix is to use a node renderer and change the target.
110
- // If using the React on Rails Pro node server renderer, uncomment the next line
111
- // serverWebpackConfig.target = 'node'
112
-
113
- return serverWebpackConfig
114
- }
115
-
116
- module.exports = configureServer
@@ -1,7 +0,0 @@
1
- const webpackConfig = require('./ServerClientOrBoth')
2
-
3
- const testOnly = (_clientWebpackConfig, _serverWebpackConfig) => {
4
- // place any code here that is for test only
5
- }
6
-
7
- module.exports = webpackConfig(testOnly)
@@ -1,24 +0,0 @@
1
- const { env, webpackConfig } = require('shakapacker')
2
- const { existsSync } = require('fs')
3
- const { resolve } = require('path')
4
-
5
- const envSpecificConfig = () => {
6
- const path = resolve(__dirname, `${env.nodeEnv}.js`)
7
- if (existsSync(path)) {
8
- console.log(`Loading ENV specific webpack configuration file ${path}`)
9
- return require(path)
10
- } else {
11
- return webpackConfig
12
- }
13
- }
14
-
15
- const webpackConfiguration = envSpecificConfig()
16
-
17
- // To debug the webpack configuration
18
- // 1. Uncomment debugger line below
19
- // 2. Run `bin/shakapacker --debug-shakapacker`
20
- // 3. Examine the webpackConfiguration variable
21
- // 4. Consider adding a 'debugger` line to the beginning of this file.
22
- // debugger
23
-
24
- module.exports = webpackConfiguration
data/spec/dummy/config.ru DELETED
@@ -1,5 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require_relative "config/environment"
4
-
5
- run Rails.application
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
- # Character.create(name: 'Luke', movie: movies.first)
File without changes
File without changes
@@ -1,44 +0,0 @@
1
- {
2
- "engines": {
3
- "node": ">=12.13.0",
4
- "yarn": ">=1 <4"
5
- },
6
- "dependencies": {
7
- "@babel/core": "^7.18.2",
8
- "@babel/plugin-transform-runtime": "^7.18.2",
9
- "@babel/preset-env": "^7.18.2",
10
- "@babel/preset-react": "^7.18.6",
11
- "@babel/preset-typescript": "^7.17.12",
12
- "@babel/runtime": "^7.18.3",
13
- "@types/react": "^16.14.26",
14
- "@types/react-dom": "^16.9.16",
15
- "babel-loader": "^8.2.5",
16
- "babel-plugin-macros": "^3.1.0",
17
- "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
18
- "compression-webpack-plugin": "^9.2.0",
19
- "css-loader": "^6.7.3",
20
- "css-minimizer-webpack-plugin": "^4.2.2",
21
- "mini-css-extract-plugin": "^2.7.2",
22
- "pnp-webpack-plugin": "^1.7.0",
23
- "prop-types": "^15.8.1",
24
- "react": "^18.2.0",
25
- "react-dom": "^18.2.0",
26
- "react-on-rails": "13.3.2",
27
- "shakapacker": "file:.yalc/shakapacker",
28
- "style-loader": "^3.3.1",
29
- "terser-webpack-plugin": "^5.3.3",
30
- "typescript": "^4.7.3",
31
- "webpack": "^5.73.0",
32
- "webpack-assets-manifest": "^5.1.0",
33
- "webpack-cli": "^4.9.2",
34
- "webpack-merge": "^5.8.0",
35
- "webpack-sources": "^3.2.3"
36
- },
37
- "devDependencies": {
38
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
39
- "fork-ts-checker-webpack-plugin": "^6.5.2",
40
- "react-refresh": "^0.14.0",
41
- "webpack-dev-server": "^4.9.2"
42
- },
43
- "packageManager": "yarn@1.22.24"
44
- }
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- require('postcss-import'),
4
- require('postcss-flexbugs-fixes'),
5
- require('postcss-preset-env')({
6
- autoprefixer: {
7
- flexbox: 'no-2009'
8
- },
9
- stage: 3
10
- })
11
- ]
12
- }
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -1,118 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- require_relative "spec_helper"
3
- ENV["RAILS_ENV"] ||= "test"
4
- require_relative "../config/environment"
5
- # Prevent database truncation if the environment is production
6
- abort("The Rails environment is running in production mode!") if Rails.env.production?
7
- require "rspec/rails"
8
- # Add additional requires below this line. Rails is not loaded until this point!
9
-
10
- require "capybara/rails"
11
-
12
- SERVER_BUNDLE_PATH = File.expand_path("../public/packs/server-bundle.js", __dir__)
13
-
14
- # Prevent database truncation if the environment is production
15
- abort("The Rails environment is running in production mode!") if Rails.env.production?
16
-
17
- Capybara.register_driver :selenium_chrome do |app|
18
- options = Selenium::WebDriver::Chrome::Options.new
19
- options.add_argument("--headless")
20
- options.add_argument("--disable-gpu")
21
- Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
22
- end
23
-
24
- # Requires supporting ruby files with custom matchers and macros, etc, in
25
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
26
- # run as spec files by default. This means that files in spec/support that end
27
- # in _spec.rb will both be required and run as specs, causing the specs to be
28
- # run twice. It is recommended that you do not name files matching this glob to
29
- # end with _spec.rb. You can configure this pattern with the --pattern
30
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
31
- #
32
- # The following line is provided for convenience purposes. It has the downside
33
- # of increasing the boot-up time by auto-requiring all files in the support
34
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
35
- # require only the support files necessary.
36
- #
37
- # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
38
-
39
- # Checks for pending migrations and applies them before tests are run.
40
- # If you are not using ActiveRecord, you can remove these lines.
41
- begin
42
- ActiveRecord::Migration.maintain_test_schema!
43
- rescue ActiveRecord::PendingMigrationError => e
44
- abort e.to_s.strip
45
- end
46
- RSpec.configure do |config|
47
- # config.before(:each, type: :system, js: true) do
48
- # driven_by :selenium_chrome
49
- # end
50
-
51
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
52
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
53
-
54
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
55
- # examples within a transaction, remove the following line or assign false
56
- # instead of true.
57
- config.use_transactional_fixtures = true
58
-
59
- # You can uncomment this line to turn off ActiveRecord support entirely.
60
- # config.use_active_record = false
61
-
62
- # RSpec Rails can automatically mix in different behaviours to your tests
63
- # based on their file location, for example enabling you to call `get` and
64
- # `post` in specs under `spec/controllers`.
65
- #
66
- # You can disable this behaviour by removing the line below, and instead
67
- # explicitly tag your specs with their type, e.g.:
68
- #
69
- # RSpec.describe UsersController, type: :controller do
70
- # # ...
71
- # end
72
- #
73
- # The different available types are documented in the features, such as in
74
- # https://rspec.info/features/6-0/rspec-rails
75
- config.infer_spec_type_from_file_location!
76
-
77
- # Capybara config
78
- config.include Capybara::DSL
79
- #
80
- # selenium_firefox webdriver only works for Travis-CI builds.
81
- default_driver = :selenium_chrome_headless
82
-
83
- supported_drivers = %i[selenium_chrome_headless selenium_chrome selenium selenium_headless]
84
- driver = ENV["DRIVER"].try(:to_sym).presence || default_driver
85
- Capybara.javascript_driver = driver
86
- Capybara.default_driver = driver
87
-
88
- raise "Unsupported driver: #{driver} (supported = #{supported_drivers})" unless supported_drivers.include?(driver)
89
-
90
- Capybara.register_server(Capybara.javascript_driver) do |app, port|
91
- require "rack/handler/puma"
92
- Rack::Handler::Puma.run(app, Port: port)
93
- end
94
-
95
- config.before(:each, type: :system, js: true) do
96
- driven_by driver
97
- end
98
-
99
- config.before(:each, type: :system, rack_test: true) do
100
- driven_by :rack_test
101
- end
102
-
103
- # Capybara.default_max_wait_time = 15
104
- Capybara.save_path = Rails.root.join("tmp", "capybara")
105
- # Capybara::Screenshot.prune_strategy = { keep: 10 }
106
-
107
- # https://github.com/mattheworiordan/capybara-screenshot/issues/243#issuecomment-620423225
108
- # config.retry_callback = proc do |ex|
109
- # Capybara.reset_sessions! if ex.metadata[:js]
110
- # end
111
-
112
- # Filter lines from Rails gems in backtraces.
113
- config.filter_rails_from_backtrace!
114
- # arbitrary gems may also be filtered via:
115
- # config.filter_gems_from_backtrace("gem name")
116
-
117
- # config.include Capybara::DSL
118
- end
@@ -1,96 +0,0 @@
1
- require "capybara/rspec"
2
-
3
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18
- RSpec.configure do |config|
19
- # rspec-expectations config goes here. You can use an alternate
20
- # assertion/expectation library such as wrong or the stdlib/minitest
21
- # assertions if you prefer.
22
- config.expect_with :rspec do |expectations|
23
- # This option will default to `true` in RSpec 4. It makes the `description`
24
- # and `failure_message` of custom matchers include text for helper methods
25
- # defined using `chain`, e.g.:
26
- # be_bigger_than(2).and_smaller_than(4).description
27
- # # => "be bigger than 2 and smaller than 4"
28
- # ...rather than:
29
- # # => "be bigger than 2"
30
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
31
- end
32
-
33
- # rspec-mocks config goes here. You can use an alternate test double
34
- # library (such as bogus or mocha) by changing the `mock_with` option here.
35
- config.mock_with :rspec do |mocks|
36
- # Prevents you from mocking or stubbing a method that does not exist on
37
- # a real object. This is generally recommended, and will default to
38
- # `true` in RSpec 4.
39
- mocks.verify_partial_doubles = true
40
- end
41
-
42
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
43
- # have no way to turn it off -- the option exists only for backwards
44
- # compatibility in RSpec 3). It causes shared context metadata to be
45
- # inherited by the metadata hash of host groups and examples, rather than
46
- # triggering implicit auto-inclusion in groups with matching metadata.
47
- config.shared_context_metadata_behavior = :apply_to_host_groups
48
-
49
- # The settings below are suggested to provide a good initial experience
50
- # with RSpec, but feel free to customize to your heart's content.
51
- =begin
52
- # This allows you to limit a spec run to individual examples or groups
53
- # you care about by tagging them with `:focus` metadata. When nothing
54
- # is tagged with `:focus`, all examples get run. RSpec also provides
55
- # aliases for `it`, `describe`, and `context` that include `:focus`
56
- # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
57
- config.filter_run_when_matching :focus
58
-
59
- # Allows RSpec to persist some state between runs in order to support
60
- # the `--only-failures` and `--next-failure` CLI options. We recommend
61
- # you configure your source control system to ignore this file.
62
- config.example_status_persistence_file_path = "spec/examples.txt"
63
-
64
- # Limits the available syntax to the non-monkey patched syntax that is
65
- # recommended. For more details, see:
66
- # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
67
- config.disable_monkey_patching!
68
-
69
- # Many RSpec users commonly either run the entire suite or an individual
70
- # file, and it's useful to allow more verbose output when running an
71
- # individual spec file.
72
- if config.files_to_run.one?
73
- # Use the documentation formatter for detailed output,
74
- # unless a formatter has already been configured
75
- # (e.g. via a command-line flag).
76
- config.default_formatter = "doc"
77
- end
78
-
79
- # Print the 10 slowest examples and example groups at the
80
- # end of the spec run, to help surface which specs are running
81
- # particularly slow.
82
- config.profile_examples = 10
83
-
84
- # Run specs in random order to surface order dependencies. If you find an
85
- # order dependency and want to debug it, you can fix the order by providing
86
- # the seed, which is printed after each run.
87
- # --seed 1234
88
- config.order = :random
89
-
90
- # Seed global randomization in this process using the `--seed` CLI option.
91
- # Setting this allows you to use `--seed` to deterministically reproduce
92
- # test failures related to randomization by passing the same `--seed` value
93
- # as the one that triggered the failure.
94
- Kernel.srand config.seed
95
- =end
96
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "../rails_helper"
4
-
5
- RSpec.describe "hello_world", **{ type: :system, js: true } do
6
- it "loads correct view" do
7
- visit "/hello_world"
8
- expect(page).to have_content "Hello, World!"
9
- expect(page).to have_content "Hello, Stranger!"
10
- end
11
-
12
- context "react component" do
13
- it "updates the text as input field gets changes" do
14
- visit "/hello_world"
15
- fill_in("name", with: "my friend")
16
- expect(page).to have_content "Hello, my friend!"
17
- end
18
- end
19
- end