shakapacker 7.3.0.beta.1 → 8.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintignore +1 -1
  3. data/.eslintrc.js +29 -8
  4. data/.github/PULL_REQUEST_TEMPLATE.md +10 -3
  5. data/.github/workflows/dummy.yml +6 -1
  6. data/.github/workflows/generator.yml +14 -18
  7. data/.github/workflows/node.yml +56 -0
  8. data/.github/workflows/ruby.yml +29 -17
  9. data/.node-version +1 -1
  10. data/.rubocop.yml +1 -0
  11. data/CHANGELOG.md +56 -5
  12. data/README.md +101 -48
  13. data/Rakefile +1 -7
  14. data/docs/customizing_babel_config.md +2 -2
  15. data/docs/deployment.md +13 -6
  16. data/docs/react.md +7 -13
  17. data/docs/troubleshooting.md +4 -4
  18. data/docs/using_esbuild_loader.md +1 -1
  19. data/docs/using_swc_loader.md +1 -1
  20. data/docs/v6_upgrade.md +1 -1
  21. data/docs/v8_upgrade.md +148 -0
  22. data/gemfiles/Gemfile-rails.7.1.x +12 -0
  23. data/jest.config.js +4 -0
  24. data/lib/install/config/shakapacker.yml +2 -2
  25. data/lib/install/template.rb +36 -30
  26. data/lib/shakapacker/base_strategy.rb +2 -1
  27. data/lib/shakapacker/compiler.rb +6 -21
  28. data/lib/shakapacker/configuration.rb +2 -46
  29. data/lib/shakapacker/deprecation_helper.rb +0 -78
  30. data/lib/shakapacker/dev_server.rb +1 -16
  31. data/lib/shakapacker/dev_server_runner.rb +2 -21
  32. data/lib/shakapacker/env.rb +1 -1
  33. data/lib/shakapacker/helper.rb +3 -3
  34. data/lib/shakapacker/instance.rb +1 -3
  35. data/lib/shakapacker/manifest.rb +1 -1
  36. data/lib/shakapacker/railtie.rb +7 -0
  37. data/lib/shakapacker/runner.rb +4 -18
  38. data/lib/shakapacker/utils/manager.rb +58 -0
  39. data/lib/shakapacker/utils/misc.rb +0 -12
  40. data/lib/shakapacker/version.rb +1 -1
  41. data/lib/shakapacker/version_checker.rb +9 -30
  42. data/lib/shakapacker/webpack_runner.rb +2 -21
  43. data/lib/shakapacker.rb +0 -2
  44. data/lib/tasks/shakapacker/check_binstubs.rake +12 -26
  45. data/lib/tasks/shakapacker/check_manager.rake +3 -8
  46. data/lib/tasks/shakapacker/info.rake +6 -15
  47. data/package/babel/preset.js +15 -15
  48. data/package/config.js +15 -19
  49. data/package/dev_server.js +4 -4
  50. data/package/env.js +19 -17
  51. data/package/environments/base.js +41 -24
  52. data/package/environments/development.js +6 -6
  53. data/package/environments/production.js +16 -16
  54. data/package/environments/test.js +1 -1
  55. data/package/esbuild/index.js +6 -6
  56. data/package/index.d.ts +0 -2
  57. data/package/index.js +17 -46
  58. data/package/rules/babel.js +6 -8
  59. data/package/rules/coffee.js +2 -2
  60. data/package/rules/css.js +1 -1
  61. data/package/rules/erb.js +4 -4
  62. data/package/rules/esbuild.js +5 -7
  63. data/package/rules/file.js +14 -7
  64. data/package/rules/index.js +11 -11
  65. data/package/rules/jscommon.js +8 -5
  66. data/package/rules/less.js +10 -9
  67. data/package/rules/raw.js +1 -1
  68. data/package/rules/sass.js +4 -4
  69. data/package/rules/stylus.js +12 -7
  70. data/package/rules/swc.js +5 -7
  71. data/package/swc/index.js +10 -10
  72. data/package/utils/configPath.js +3 -18
  73. data/package/utils/defaultConfigPath.js +1 -1
  74. data/package/utils/{get_style_rule.js → getStyleRule.js} +6 -6
  75. data/package/utils/helpers.js +2 -43
  76. data/package/utils/inliningCss.js +4 -3
  77. data/package/utils/snakeToCamelCase.js +5 -0
  78. data/package/webpackDevServerConfig.js +28 -25
  79. data/package.json +12 -18
  80. data/prettier.config.js +4 -0
  81. data/shakapacker.gemspec +1 -1
  82. data/spec/dummy/app/javascript/packs/application.js +1 -1
  83. data/spec/dummy/config/application.rb +3 -0
  84. data/spec/dummy/config/initializers/react_on_rails.rb +2 -2
  85. data/spec/dummy/config/shakapacker.yml +3 -4
  86. data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -1
  87. data/spec/dummy/config/webpack/webpack.config.js +1 -1
  88. data/spec/dummy/package.json +2 -1
  89. data/spec/dummy/yarn.lock +2 -3
  90. data/spec/fixtures/github_url_package-lock.v1.json +1 -1
  91. data/spec/fixtures/github_url_package-lock.v2.json +2 -2
  92. data/spec/fixtures/github_url_package.json +1 -1
  93. data/spec/fixtures/github_url_pnpm-lock.v7.yaml +1 -1
  94. data/spec/fixtures/github_url_pnpm-lock.v8.yaml +1 -1
  95. data/spec/fixtures/github_url_yarn.v1.lock +1 -1
  96. data/spec/fixtures/github_url_yarn.v2.lock +2 -2
  97. data/spec/generator_specs/e2e_template/template.rb +15 -28
  98. data/spec/generator_specs/generator_spec.rb +6 -136
  99. data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -1
  100. data/spec/shakapacker/compiler_spec.rb +1 -3
  101. data/spec/shakapacker/configuration_spec.rb +4 -56
  102. data/spec/shakapacker/dev_server_runner_spec.rb +19 -102
  103. data/spec/shakapacker/dev_server_spec.rb +1 -16
  104. data/spec/shakapacker/engine_rake_tasks_spec.rb +1 -16
  105. data/spec/shakapacker/helper_spec.rb +3 -3
  106. data/spec/shakapacker/instance_spec.rb +1 -3
  107. data/spec/shakapacker/rake_tasks_spec.rb +2 -14
  108. data/spec/shakapacker/shakapacker_spec.rb +0 -1
  109. data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -1
  110. data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -1
  111. data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -1
  112. data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -1
  113. data/spec/shakapacker/test_app/package.json +2 -1
  114. data/spec/shakapacker/utils_manager_spec.rb +125 -0
  115. data/spec/shakapacker/version_checker_spec.rb +5 -5
  116. data/spec/shakapacker/webpack_runner_spec.rb +19 -28
  117. data/spec/support/package_json_helpers.rb +7 -4
  118. data/test/helpers.js +67 -0
  119. data/test/package/config.test.js +50 -0
  120. data/test/package/dev_server.test.js +44 -0
  121. data/test/package/development.test.js +43 -0
  122. data/test/package/env.test.js +57 -0
  123. data/test/package/environments/base.test.js +105 -0
  124. data/test/package/environments/development.test.js +50 -0
  125. data/test/package/environments/production.test.js +106 -0
  126. data/test/package/index.test.js +45 -0
  127. data/test/package/production.test.js +32 -0
  128. data/test/package/rules/babel.test.js +58 -0
  129. data/test/package/rules/esbuild.test.js +59 -0
  130. data/test/package/rules/file.test.js +81 -0
  131. data/test/package/rules/index.test.js +7 -0
  132. data/test/package/rules/raw.test.js +12 -0
  133. data/test/package/rules/swc.test.js +59 -0
  134. data/test/package/staging.test.js +31 -0
  135. data/test/package/test.test.js +28 -0
  136. data/yarn.lock +1278 -421
  137. metadata +50 -100
  138. data/.github/workflows/jest.yml +0 -33
  139. data/.github/workflows/js-lint.yml +0 -33
  140. data/.github/workflows/rubocop.yml +0 -28
  141. data/.github/workflows/ruby-backward-compatibility.yml +0 -51
  142. data/lib/install/package.json +0 -15
  143. data/lib/tasks/shakapacker/check_yarn.rake +0 -34
  144. data/lib/tasks/shakapacker/yarn_install.rake +0 -24
  145. data/lib/tasks/webpacker/binstubs.rake +0 -9
  146. data/lib/tasks/webpacker/check_binstubs.rake +0 -9
  147. data/lib/tasks/webpacker/check_node.rake +0 -9
  148. data/lib/tasks/webpacker/check_yarn.rake +0 -9
  149. data/lib/tasks/webpacker/clean.rake +0 -9
  150. data/lib/tasks/webpacker/clobber.rake +0 -11
  151. data/lib/tasks/webpacker/compile.rake +0 -9
  152. data/lib/tasks/webpacker/info.rake +0 -9
  153. data/lib/tasks/webpacker/install.rake +0 -9
  154. data/lib/tasks/webpacker/verify_config.rake +0 -9
  155. data/lib/tasks/webpacker/verify_install.rake +0 -9
  156. data/lib/tasks/webpacker/yarn_install.rake +0 -9
  157. data/lib/tasks/webpacker.rake +0 -20
  158. data/lib/webpacker/dev_server_runner.rb +0 -9
  159. data/lib/webpacker/webpack_runner.rb +0 -9
  160. data/lib/webpacker.rb +0 -4
  161. data/package/__tests__/config-bc.js +0 -27
  162. data/package/__tests__/config.js +0 -46
  163. data/package/__tests__/dev_server-bc.js +0 -46
  164. data/package/__tests__/dev_server.js +0 -46
  165. data/package/__tests__/development-bc.js +0 -66
  166. data/package/__tests__/development.js +0 -66
  167. data/package/__tests__/env-bc.js +0 -59
  168. data/package/__tests__/env.js +0 -59
  169. data/package/__tests__/index-bc.js +0 -22
  170. data/package/__tests__/index.js +0 -46
  171. data/package/__tests__/production-bc.js +0 -51
  172. data/package/__tests__/production.js +0 -51
  173. data/package/__tests__/staging-bc.js +0 -53
  174. data/package/__tests__/staging.js +0 -53
  175. data/package/__tests__/test-bc.js +0 -43
  176. data/package/__tests__/test.js +0 -43
  177. data/package/environments/__tests__/base-bc.js +0 -107
  178. data/package/environments/__tests__/base.js +0 -107
  179. data/package/environments/__tests__/development.js +0 -53
  180. data/package/environments/__tests__/production.js +0 -92
  181. data/package/rules/__tests__/__utils__/webpack.js +0 -50
  182. data/package/rules/__tests__/babel.js +0 -63
  183. data/package/rules/__tests__/esbuild.js +0 -64
  184. data/package/rules/__tests__/file.js +0 -79
  185. data/package/rules/__tests__/index.js +0 -7
  186. data/package/rules/__tests__/raw.js +0 -18
  187. data/package/rules/__tests__/swc.js +0 -63
  188. data/package/utils/snakeToCamelCase +0 -7
  189. data/spec/backward_compatibility_specs/command_spec.rb +0 -116
  190. data/spec/backward_compatibility_specs/compiler_spec.rb +0 -59
  191. data/spec/backward_compatibility_specs/compiler_strategy_spec.rb +0 -24
  192. data/spec/backward_compatibility_specs/configuration_spec.rb +0 -294
  193. data/spec/backward_compatibility_specs/dev_server_runner_spec.rb +0 -206
  194. data/spec/backward_compatibility_specs/dev_server_spec.rb +0 -47
  195. data/spec/backward_compatibility_specs/digest_strategy_spec.rb +0 -38
  196. data/spec/backward_compatibility_specs/engine_rake_tasks_spec.rb +0 -67
  197. data/spec/backward_compatibility_specs/env_spec.rb +0 -23
  198. data/spec/backward_compatibility_specs/helper_spec.rb +0 -243
  199. data/spec/backward_compatibility_specs/instance_spec.rb +0 -31
  200. data/spec/backward_compatibility_specs/manifest_spec.rb +0 -100
  201. data/spec/backward_compatibility_specs/mtime_strategy_spec.rb +0 -55
  202. data/spec/backward_compatibility_specs/rake_tasks_spec.rb +0 -41
  203. data/spec/backward_compatibility_specs/spec_helper_initializer.rb +0 -24
  204. data/spec/backward_compatibility_specs/webpack_runner_spec.rb +0 -86
  205. data/spec/backward_compatibility_specs/webpacker_spec.rb +0 -41
  206. data/spec/backward_compatibility_specs/webpacker_test_app/.gitignore +0 -2
  207. data/spec/backward_compatibility_specs/webpacker_test_app/Rakefile +0 -3
  208. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/application.js +0 -10
  209. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/generated/something.js +0 -2
  210. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.css +0 -4
  211. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.js +0 -4
  212. data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker +0 -13
  213. data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker-dev-server +0 -13
  214. data/spec/backward_compatibility_specs/webpacker_test_app/config/application.rb +0 -11
  215. data/spec/backward_compatibility_specs/webpacker_test_app/config/environment.rb +0 -4
  216. data/spec/backward_compatibility_specs/webpacker_test_app/config/initializers/inspect_autoload_paths.rb +0 -1
  217. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpack/webpack.config.js +0 -0
  218. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker.yml +0 -83
  219. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_css_extract_ignore_order_warnings.yml +0 -84
  220. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_defaults_fallback.yml +0 -11
  221. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_manifest_path.yml +0 -80
  222. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_nested_entries.yml +0 -83
  223. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_no_precompile.yml +0 -7
  224. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_other_location.yml +0 -85
  225. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_public_root.yml +0 -18
  226. data/spec/backward_compatibility_specs/webpacker_test_app/config.ru +0 -5
  227. data/spec/backward_compatibility_specs/webpacker_test_app/package.json +0 -13
  228. data/spec/backward_compatibility_specs/webpacker_test_app/public/packs/manifest.json +0 -58
  229. data/spec/backward_compatibility_specs/webpacker_test_app/some.config.js +0 -0
  230. data/spec/backward_compatibility_specs/webpacker_test_app/tmp/shakapacker/last-compilation-digest-production +0 -1
  231. data/spec/backward_compatibility_specs/webpacker_test_app/yarn.lock +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32122fb686bab6ec0cfeba217c5d53ad88cf40897fe08564475a4e8fa8b79962
4
- data.tar.gz: 1304bdd1f5d735bcc3642ae27a1d9151a75ca1a7c3cf33b1217163577f43a193
3
+ metadata.gz: ec98bf8d86496333c62b85cc9abbb31f44bdfb4844d64c65d7faf1bec76c8003
4
+ data.tar.gz: 3b05acd544a8cb23d74c641ee746385260eb5c0708b9af230dc1c813c7c9977c
5
5
  SHA512:
6
- metadata.gz: c77d2e756603a02a42e5b3a5917cb77cce6b112edee947572348057adde9b4bb696c7cdffa592dcee63d851c2cbd04c4143504ed5edaa3ced7206b5c6a88f767
7
- data.tar.gz: cdfa1f6f2771eef452dc9a0f3d447ff437bb99ac0b5427381d20042b83734d85f7e21eaf7559bd712788db2f788178c663a4b9117babc44441fb29fc079d5053
6
+ metadata.gz: f9174d503f9e8dc6447c124dd236c3b65a66f23b780cea48e46e8921c5c4bcbcc0f5b75165175cd19f8177edce67e6c49128de58631272edcbecf5eb0431a13f
7
+ data.tar.gz: 2f8c44e24add0bc1930f2d6dbb58d20f6f5f82efbd0ffdf245b8ce85da4c4fa7c7d9dab07fc6d60f6709265b4e2ed23e0194040d8cba6c60cd62ef92e4e16d8e
data/.eslintignore CHANGED
@@ -1,4 +1,4 @@
1
1
  lib/*
2
2
  node_modules/*
3
3
  vendor/*
4
- **/__tests__/**/*
4
+ spec/*
data/.eslintrc.js CHANGED
@@ -1,15 +1,36 @@
1
1
  module.exports = {
2
- extends: ['airbnb', 'prettier'],
2
+ extends: ["airbnb", "plugin:prettier/recommended"],
3
3
  rules: {
4
- 'comma-dangle': ['error', 'never'],
5
- 'import/no-unresolved': 'off',
6
- 'import/no-extraneous-dependencies': 'off',
7
- 'import/extensions': 'off',
8
- "indent": ["error", 2],
9
- semi: ['error', 'never']
4
+ "import/no-unresolved": "off",
5
+ "import/no-extraneous-dependencies": "off",
6
+ "import/extensions": "off",
7
+ indent: ["error", 2]
10
8
  },
11
9
  env: {
12
10
  browser: true,
13
11
  node: true
14
- }
12
+ },
13
+ overrides: [
14
+ {
15
+ files: ["test/**"],
16
+ extends: ["plugin:jest/recommended", "plugin:jest/style"],
17
+ rules: {
18
+ "global-require": "off",
19
+ "jest/prefer-called-with": "error",
20
+ "jest/no-conditional-in-test": "error",
21
+ "jest/no-test-return-statement": "error",
22
+ "jest/prefer-expect-resolves": "error",
23
+ "jest/require-to-throw-message": "error",
24
+ "jest/require-top-level-describe": "error",
25
+ "jest/prefer-hooks-on-top": "error",
26
+ "jest/prefer-lowercase-title": [
27
+ "error",
28
+ { ignoreTopLevelDescribe: true }
29
+ ],
30
+ "jest/prefer-spy-on": "error",
31
+ "jest/prefer-strict-equal": "error",
32
+ "jest/prefer-todo": "error"
33
+ }
34
+ }
35
+ ]
15
36
  }
@@ -1,9 +1,13 @@
1
1
  ### Summary
2
2
 
3
- _Remove this paragraph and describe the code changes in your pull request... were there any bugs you had fixed? If so, mention them. If these bugs have open GitHub issues, tag them here as well to keep the conversation linked._
3
+ <!--
4
+ Describe the code changes in your pull request here - were there any bugs you had fixed, features you added, tradeoffs you made?
5
+ If so, mention them. If these changes have open GitHub issues, tag them here as well to keep the conversation linked.
6
+ -->
4
7
 
5
8
  ### Pull Request checklist
6
- _Remove this line after checking all the items here. If the item does not apply to the PR, both check it out and wrap it by `~`._
9
+
10
+ <!-- If any of the items on this checklist do not apply to the PR, both check it out and wrap it by `~`. -->
7
11
 
8
12
  - [ ] Add/update test to cover these changes
9
13
  - [ ] Update documentation
@@ -11,4 +15,7 @@ _Remove this line after checking all the items here. If the item does not apply
11
15
 
12
16
  ### Other Information
13
17
 
14
- _Remove this paragraph and mention other important and relevant information, such as benchmarks._
18
+ <!--
19
+ Mention any other important information that might relate to this PR but that don't belong in the summary,
20
+ like detailed benchmarks or possible follow-up changes.
21
+ -->
@@ -3,9 +3,14 @@ name: Dummy specs
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'master'
6
+ - 'main'
7
7
  pull_request:
8
8
 
9
+ concurrency:
10
+ # Pushing new changes to a branch will cancel any in-progress CI runs
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
9
14
  jobs:
10
15
  test:
11
16
  runs-on: ubuntu-latest
@@ -3,9 +3,14 @@ name: Generator specs
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'master'
6
+ - 'main'
7
7
  pull_request:
8
8
 
9
+ concurrency:
10
+ # Pushing new changes to a branch will cancel any in-progress CI runs
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
9
14
  jobs:
10
15
  test:
11
16
  name: Generator specs
@@ -13,22 +18,21 @@ jobs:
13
18
  strategy:
14
19
  matrix:
15
20
  os: [ubuntu-latest]
16
- ruby: ['2.6', '2.7', '3.0']
17
- use_package_json_gem: ['true', 'false']
21
+ ruby: ['2.7', '3.0', '3.1', '3.2']
18
22
  gemfile:
19
23
  - gemfiles/Gemfile-rails.6.0.x
20
24
  - gemfiles/Gemfile-rails.6.1.x
21
25
  - gemfiles/Gemfile-rails.7.0.x
26
+ - gemfiles/Gemfile-rails.7.1.x
22
27
  # Uncomment the following line only to ensure compatibility with the
23
28
  # upcomming Rails versions, maybe before a release.
24
29
  #- gemfiles/Gemfile-rails-edge
25
30
  exclude:
26
- - ruby: 2.6
27
- os: ubuntu-latest
28
- gemfile: gemfiles/Gemfile-rails.7.0.x
29
- - ruby: 2.6
30
- os: ubuntu-latest
31
- gemfile: gemfiles/Gemfile-rails-edge
31
+ - ruby: '3.1'
32
+ gemfile: gemfiles/Gemfile-rails.6.0.x
33
+ - ruby: '3.2'
34
+ gemfile: gemfiles/Gemfile-rails.6.0.x
35
+
32
36
  env:
33
37
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
34
38
 
@@ -39,13 +43,5 @@ jobs:
39
43
  - uses: ruby/setup-ruby@v1
40
44
  with:
41
45
  ruby-version: ${{ matrix.ruby }}
42
- # Bundler 2.5.0 dropped support for Ruby 2.6 and 2.7
43
- - name: Use Bundler 2.4.22
44
- run: |
45
- gem install bundler -v '2.4.22'
46
- bundle config --local path vendor/bundle
47
- - name: Install dependencies
48
- run: bundle install
46
+ bundler-cache: true
49
47
  - run: bundle exec rake run_spec:generator
50
- env:
51
- SHAKAPACKER_USE_PACKAGE_JSON_GEM: ${{ matrix.use_package_json_gem }}
@@ -0,0 +1,56 @@
1
+ name: Node based checks
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - 'main'
7
+ pull_request:
8
+
9
+ concurrency:
10
+ # Pushing new changes to a branch will cancel any in-progress CI runs
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ lint:
16
+ name: Linting
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ persist-credentials: false
23
+ - uses: actions/setup-node@v4
24
+ with:
25
+ node-version: 20.x
26
+ cache: yarn
27
+
28
+ - name: Install dependencies
29
+ run: yarn --frozen-lockfile --non-interactive --prefer-offline
30
+
31
+ - name: Node eslint
32
+ run: yarn lint
33
+ test:
34
+ name: Testing
35
+ strategy:
36
+ matrix:
37
+ os: [ubuntu-latest]
38
+ node: [14.x, 16.x, 18.x, 20.x]
39
+
40
+ runs-on: ${{ matrix.os }}
41
+
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ with:
45
+ persist-credentials: false
46
+ - name: Use Node.js ${{ matrix.node }}
47
+ uses: actions/setup-node@v3
48
+ with:
49
+ node-version: ${{ matrix.node }}
50
+ cache: yarn
51
+
52
+ - name: Install dependencies
53
+ run: yarn --frozen-lockfile --non-interactive --prefer-offline
54
+
55
+ - name: Jest Specs
56
+ run: yarn test
@@ -1,33 +1,52 @@
1
- name: Ruby specs
1
+ name: Ruby based checks
2
2
 
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - 'master'
6
+ - 'main'
7
7
  pull_request:
8
8
 
9
+ concurrency:
10
+ # Pushing new changes to a branch will cancel any in-progress CI runs
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
9
14
  jobs:
15
+ lint:
16
+ name: Linting
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ persist-credentials: false
22
+ - uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: '3.2'
25
+ bundler-cache: true
26
+
27
+ - name: Ruby rubocop
28
+ run: bundle exec rubocop
29
+
10
30
  test:
11
- name: Ruby specs
31
+ name: Testing
12
32
  runs-on: ${{ matrix.os }}
13
33
  strategy:
14
34
  matrix:
15
35
  os: [ubuntu-latest]
16
- ruby: ['2.6', '2.7', '3.0']
36
+ ruby: ['2.7', '3.0', '3.1', '3.2']
17
37
  gemfile:
18
38
  - gemfiles/Gemfile-rails.6.0.x
19
39
  - gemfiles/Gemfile-rails.6.1.x
20
40
  - gemfiles/Gemfile-rails.7.0.x
41
+ - gemfiles/Gemfile-rails.7.1.x
21
42
  # Uncomment the following line only to ensure compatibility with the
22
43
  # upcomming Rails versions, maybe before a release.
23
44
  #- gemfiles/Gemfile-rails-edge
24
45
  exclude:
25
- - ruby: 2.6
26
- os: ubuntu-latest
27
- gemfile: gemfiles/Gemfile-rails.7.0.x
28
- - ruby: 2.6
29
- os: ubuntu-latest
30
- gemfile: gemfiles/Gemfile-rails-edge
46
+ - ruby: '3.1'
47
+ gemfile: gemfiles/Gemfile-rails.6.0.x
48
+ - ruby: '3.2'
49
+ gemfile: gemfiles/Gemfile-rails.6.0.x
31
50
 
32
51
  env:
33
52
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -43,10 +62,3 @@ jobs:
43
62
 
44
63
  - name: Ruby specs
45
64
  run: bundle exec rake run_spec:gem
46
- env:
47
- SHAKAPACKER_USE_PACKAGE_JSON_GEM: "false"
48
-
49
- - name: Ruby specs
50
- run: bundle exec rake run_spec:gem
51
- env:
52
- SHAKAPACKER_USE_PACKAGE_JSON_GEM: "true"
data/.node-version CHANGED
@@ -1 +1 @@
1
- 16.14.0
1
+ 21.0.0
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  require: rubocop-performance
2
2
  AllCops:
3
+ TargetRubyVersion: 2.7
3
4
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
5
  # to ignore them, so only the ones explicitly set in this file are enabled.
5
6
  DisabledByDefault: true
data/CHANGELOG.md CHANGED
@@ -1,20 +1,70 @@
1
1
  * For the changelog of versions prior to v6, see the [5.x stable branch of rails/webpacker](https://github.com/rails/webpacker/tree/5-x-stable).
2
+ * Please see the [v8 Upgrade Guide](./docs/v8_upgrade.md) for upgrading to version 8 and accounting for breaking changes.
2
3
  * Please see the [v7 Upgrade Guide](./docs/v7_upgrade.md) for upgrading to new spelling in version 7.
3
4
  * Please see the [v6 Upgrade Guide](./docs/v6_upgrade.md) to go from versions prior to v6.
4
5
  * [ShakaCode](https://www.shakacode.com) offers support for upgrading from Webpacker or using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com).
5
6
 
7
+ _next_ branch is for v8 changes
8
+
6
9
  ## Versions
7
10
  ## [Unreleased]
8
11
  Changes since the last non-beta release.
9
12
 
13
+ ### Breaking changes
14
+ - Remove `relative_url_root` [PR 413](https://github.com/shakacode/shakapacker/pull/413) by [G-Rath](https://github.com/g-rath).
15
+
16
+ - Removes deprecated support of `Webpacker` spelling, config variables and constants. [PR 429](https://github.com/shakacode/shakapacker/pull/429) by [tomdracz](https://github.com/tomdracz).
17
+
18
+ The usage of those has been deprecated in Shakapacker v7 and now fully removed in v8. See the [v7 Upgrade Guide](./docs/v7_upgrade.md) for more information if you are still yet to address this deprecation.
19
+
20
+ - Remove `globalMutableWebpackConfig` global [PR 439](https://github.com/shakacode/shakapacker/pull/439) by [G-Rath](https://github.com/g-rath).
21
+
22
+ Use `generateWebpackConfig` instead.
23
+
24
+ - Use `package_json` gem to manage Node dependencies and commands, and use `npm` by default [PR 430](https://github.com/shakacode/shakapacker/pull/430) by [G-Rath](https://github.com/g-rath)
25
+
26
+ This enables support for package managers other than `yarn`, with `npm` being the default; to continue using Yarn,
27
+ specify it in `package.json` using the [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) property.
28
+
29
+ - Remove `yarn_install` rake task, and stop installing js packages automatically as part of `assets:precompile` [PR 412](https://github.com/shakacode/shakapacker/pull/412) by [G-Rath](https://github.com/g-rath).
30
+
31
+ - Remove `check_yarn` rake task [PR 443](https://github.com/shakacode/shakapacker/pull/443) by [G-Rath](https://github.com/g-rath).
32
+
33
+ - Remove `https` option for `webpack-dev-server` [PR 414](https://github.com/shakacode/shakapacker/pull/414) by [G-Rath](https://github.com/g-rath).
34
+
35
+ - Remove `verify_file_existance` method [PR 446](https://github.com/shakacode/shakapacker/pull/446) by [G-Rath](https://github.com/g-rath).
36
+
37
+ - Drop support for Ruby 2.6 [PR 415](https://github.com/shakacode/shakapacker/pull/415) by [G-Rath](https://github.com/g-rath).
38
+
39
+ - Drop support for Node v12 [PR 431](https://github.com/shakacode/shakapacker/pull/431) by [G-Rath](https://github.com/g-rath).
40
+
41
+ - Enable `ensure_consistent_versioning` by default [PR 447](https://github.com/shakacode/shakapacker/pull/447) by [G-Rath](https://github.com/g-rath).
42
+
43
+ - Asset files put in `additional_paths` will have their path stripped just like with the `source_path`. [PR 403](https://github.com/shakacode/shakapacker/pull/403) by [paypro-leon](https://github.com/paypro-leon).
44
+
45
+ - Remove `isArray` utility (just use `Array.isArray` directly) and renamed a few files [PR 454](https://github.com/shakacode/shakapacker/pull/454) by [G-Rath](https://github.com/g-rath).
46
+
47
+ - Make JavaScript test helper utilities internal (`chdirTestApp`, `chdirCwd`, `resetEnv`) [PR 458](https://github.com/shakacode/shakapacker/pull/458) by [G-Rath](https://github.com/g-rath).
48
+
49
+ ## [v7.2.3] - March 23, 2024
50
+
51
+ ### Added
52
+ - Emit warnings instead of errors when compilation is success but stderr is not empty. [PR 416](https://github.com/shakacode/shakapacker/pull/416) by [n-rodriguez](https://github.com/n-rodriguez).
53
+ - Allow `webpack-dev-server` v5. [PR 418](https://github.com/shakacode/shakapacker/pull/418) by [G-Rath](https://github.com/g-rath)
54
+
55
+ ### Removed
56
+ - Removes dependency on `glob` library. [PR 435](https://github.com/shakacode/shakapacker/pull/435) by [tomdracz](https://github.com/tomdracz).
57
+
58
+ ### Fixed
59
+ - Uses config file passed in `SHAKAPACKER_CONFIG` consistently.[PR 448](https://github.com/shakacode/shakapacker/pull/448) by [tomdracz](https://github.com/tomdracz).
60
+
61
+ Previously this could have been ignored in few code branches, especially when checking for available environments.
62
+
10
63
  ## [v7.2.2] - January 19, 2024
11
64
 
12
65
  ### Added
13
66
  - Allow `compression-webpack-plugin` v11. [PR 406](https://github.com/shakacode/shakapacker/pull/406) by [tagliala](https://github.com/tagliala).
14
67
 
15
- ### Changed
16
- - Just like with the `source_path` the paths in `additional_paths` will now also be stripped from asset paths. [PR 403](https://github.com/shakacode/shakapacker/pull/403) by [paypro-leon](https://github.com/paypro-leon).
17
-
18
68
  ## [v7.2.1] - December 30, 2023
19
69
 
20
70
  ### Fixed
@@ -65,7 +115,7 @@ Changes since the last non-beta release.
65
115
 
66
116
  - Export immutable webpackConfig function. [PR 293](https://github.com/shakacode/shakapacker/pull/293) by [tomdracz](https://github.com/tomdracz).
67
117
 
68
- The `webpackConfig` property in the `shakapacker` module has been updated to be a function instead of a global mutable webpack configuration. This function now returns an immutable webpack configuration object, which ensures that any modifications made to it will not affect any other usage of the webpack configuration. If a project still requires the old mutable object, it can be accessed by replacing `webpackConfig` with `globalMutableWebpackConfig`. Check [v7-upgrade](https://github.com/shakacode/shakapacker/blob/master/docs/v7_upgrade.md) documentation for more detail.
118
+ The `webpackConfig` property in the `shakapacker` module has been updated to be a function instead of a global mutable webpack configuration. This function now returns an immutable webpack configuration object, which ensures that any modifications made to it will not affect any other usage of the webpack configuration. If a project still requires the old mutable object, it can be accessed by replacing `webpackConfig` with `globalMutableWebpackConfig`. Check [v7-upgrade](https://github.com/shakacode/shakapacker/blob/main/docs/v7_upgrade.md) documentation for more detail.
69
119
 
70
120
  ### Added
71
121
  - Set CSS modules mode depending on file type. [PR 261](https://github.com/shakacode/shakapacker/pull/261) by [talyuk](https://github.com/talyuk).
@@ -303,7 +353,8 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
303
353
  ## v5.4.3 and prior changes from rails/webpacker
304
354
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
305
355
 
306
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v7.2.2...master
356
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v7.2.3...main
357
+ [v7.2.3]: https://github.com/shakacode/shakapacker/compare/v7.2.2...v7.2.3
307
358
  [v7.2.2]: https://github.com/shakacode/shakapacker/compare/v7.2.1...v7.2.2
308
359
  [v7.2.1]: https://github.com/shakacode/shakapacker/compare/v7.2.0...v7.2.1
309
360
  [v7.2.0]: https://github.com/shakacode/shakapacker/compare/v7.1.0...v7.2.0