shakapacker 9.3.2 → 9.3.4.beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0516b9d770d17a8e04f5b51e49f854823339760856dfd93a281586ea975513db
4
- data.tar.gz: e0951145646eaeca52df5fc65aba8217e60de0ad0ea10de21271d6e7e62f7b6f
3
+ metadata.gz: 6f91e082c004aed62a936ae04be5d4a86adb4532deebe84f55662660f3735f67
4
+ data.tar.gz: aa26a6595a4f37bb61f83d10e978e77f5b6cbe2df50debb7428ecb9f8a6f1072
5
5
  SHA512:
6
- metadata.gz: 32963185a3ef79ffe8da898d800d9c014acc34854ad17dadb30243b5c46a6ae7caa74be034d1c9971048fab0809ba2caefae3ad82faa86d5684ed2dd46782a6c
7
- data.tar.gz: 80f01b964e5df32104861c13a3e1924e497fa57f0201f4522417c407bc52bcf89e26315146d1e441fa5cd4a092994438aa2449ee95a07ba9c5c51eb6f48f830e
6
+ metadata.gz: efeea8ba10d3a7df9d4a5d14d7f7f34169202ebd2f7f9c16e1875cdb55531be5155600ba2a06cb2fa53866785fd0a374742f2b420be68c12430a7597b553e23c
7
+ data.tar.gz: 89965343135e74749d0a04cafd1c6a931b311d62432c25cfc6f3e9c1bcbee4274605a200211d39622e6934a376f00b092b556238586d1742603398b0862b7d34
data/CHANGELOG.md CHANGED
@@ -11,9 +11,27 @@
11
11
 
12
12
  Changes since the last non-beta release.
13
13
 
14
+ ## [v9.3.3] - November 15, 2025
15
+
16
+ ### Fixed
17
+
18
+ - **Fixed `switch_bundler` task to preserve shared dependencies**. [PR #836](https://github.com/shakacode/shakapacker/pull/836) by [justin808](https://github.com/justin808). The task no longer removes `@swc/core`, `swc-loader`, and `webpack-merge` when switching bundlers, as these packages are shared between webpack and rspack configurations.
19
+
20
+ ## [v9.3.2] - November 10, 2025
21
+
14
22
  ### Fixed
15
23
 
16
- - Use `@ts-ignore` to suppress potential import error in public types when `webpack` is not installed. [PR #828](https://github.com/shakacode/shakapacker/pull/828) by [G-Rath]
24
+ - **Fixed TypeScript import error in public types when webpack is not installed**. [PR #828](https://github.com/shakacode/shakapacker/pull/828) by [G-Rath](https://github.com/G-Rath). Uses `@ts-ignore` instead of `@ts-expect-error` to suppress potential import error when webpack is not installed.
25
+ - **Fixed bundler switch task to add missing `assets_bundler` config**. [PR #833](https://github.com/shakacode/shakapacker/pull/833) by [justin808](https://github.com/justin808). The `rake shakapacker:switch_bundler` task now automatically adds the `assets_bundler` key to `shakapacker.yml` if it's missing, preventing silent failures when switching bundlers.
26
+ - **Fixed rake tasks to use `bundle exec rake` instead of `bundle exec rails`**. [PR #830](https://github.com/shakacode/shakapacker/pull/830) by [Judahmeek](https://github.com/Judahmeek). Rake tasks should be invoked with `bundle exec rake` to support command-line flags properly, as Rails commands don't support flags.
27
+
28
+ ### Added
29
+
30
+ - **Support for esbuild 0.26 and 0.27**. [PR #832](https://github.com/shakacode/shakapacker/pull/832) by [justin808](https://github.com/justin808). Extended peer dependency range to support newer esbuild versions.
31
+
32
+ ### Changed
33
+
34
+ - **Simplified `switch_bundler` task to only support rake command**. [PR #831](https://github.com/shakacode/shakapacker/pull/831) by [justin808](https://github.com/justin808). The `rake shakapacker:switch_bundler` task now only works with `bundle exec rake`, not `bundle exec rails`. Use `bundle exec rake shakapacker:switch_bundler [bundler] -- [options]` for clearer command-line flag support.
17
35
 
18
36
  ## [v9.3.1] - November 9, 2025
19
37
 
@@ -734,7 +752,9 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
734
752
 
735
753
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
736
754
 
737
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v9.3.1...main
755
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v9.3.3...main
756
+ [v9.3.3]: https://github.com/shakacode/shakapacker/compare/v9.3.2...v9.3.3
757
+ [v9.3.2]: https://github.com/shakacode/shakapacker/compare/v9.3.1...v9.3.2
738
758
  [v9.3.1]: https://github.com/shakacode/shakapacker/compare/v9.3.0...v9.3.1
739
759
  [v9.3.0]: https://github.com/shakacode/shakapacker/compare/v9.2.0...v9.3.0
740
760
  [v9.2.0]: https://github.com/shakacode/shakapacker/compare/v9.1.0...v9.2.0
data/CONTRIBUTING.md CHANGED
@@ -70,7 +70,7 @@ yarn lint --cache
70
70
 
71
71
  ## Setting Up a Development Environment
72
72
 
73
- 1. Install [Yarn](https://classic.yarnpkg.com/)
73
+ 1. Install [Yarn](https://classic.yarnpkg.com/) & [yalc](https://github.com/wclr/yalc)
74
74
  2. To test your changes on a Rails test project do the following steps:
75
75
  - For Ruby gem, update `Gemfile` and point the `shakapacker` to the locally developing Shakapacker project:
76
76
  ```ruby
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shakapacker (9.3.2)
4
+ shakapacker (9.3.4.beta.0)
5
5
  activesupport (>= 5.2)
6
6
  package_json
7
7
  rack-proxy (>= 0.6.1)
@@ -12,15 +12,24 @@ module Shakapacker
12
12
  # Regex pattern to detect assets_bundler key in config (only matches uncommented lines)
13
13
  ASSETS_BUNDLER_PATTERN = /^[ \t]*assets_bundler:/
14
14
 
15
+ # Shared dependencies used by both webpack and rspack
16
+ # These should not be removed when switching bundlers
17
+ SHARED_DEPS = {
18
+ dev: %w[],
19
+ prod: %w[webpack-merge]
20
+ }.freeze
21
+
15
22
  # Default dependencies for each bundler (package names only, no versions)
23
+ # Note: Excludes independent/optional dependencies like @swc/core, swc-loader (user-configured
24
+ # transpilers)
16
25
  DEFAULT_RSPACK_DEPS = {
17
26
  dev: %w[@rspack/cli @rspack/plugin-react-refresh],
18
27
  prod: %w[@rspack/core rspack-manifest-plugin]
19
28
  }.freeze
20
29
 
21
30
  DEFAULT_WEBPACK_DEPS = {
22
- dev: %w[webpack webpack-cli webpack-dev-server @pmmmwh/react-refresh-webpack-plugin @swc/core swc-loader],
23
- prod: %w[webpack-assets-manifest webpack-merge]
31
+ dev: %w[webpack webpack-cli webpack-dev-server @pmmmwh/react-refresh-webpack-plugin],
32
+ prod: %w[webpack-assets-manifest]
24
33
  }.freeze
25
34
 
26
35
  attr_reader :root_path
@@ -148,16 +157,24 @@ module Shakapacker
148
157
  raise
149
158
  end
150
159
  rspack_deps = {
151
- dev: custom.dig("rspack", "devDependencies") || DEFAULT_RSPACK_DEPS[:dev],
152
- prod: custom.dig("rspack", "dependencies") || DEFAULT_RSPACK_DEPS[:prod]
160
+ dev: (custom.dig("rspack", "devDependencies") || DEFAULT_RSPACK_DEPS[:dev]) + SHARED_DEPS[:dev],
161
+ prod: (custom.dig("rspack", "dependencies") || DEFAULT_RSPACK_DEPS[:prod]) + SHARED_DEPS[:prod]
153
162
  }
154
163
  webpack_deps = {
155
- dev: custom.dig("webpack", "devDependencies") || DEFAULT_WEBPACK_DEPS[:dev],
156
- prod: custom.dig("webpack", "dependencies") || DEFAULT_WEBPACK_DEPS[:prod]
164
+ dev: (custom.dig("webpack", "devDependencies") || DEFAULT_WEBPACK_DEPS[:dev]) + SHARED_DEPS[:dev],
165
+ prod: (custom.dig("webpack", "dependencies") || DEFAULT_WEBPACK_DEPS[:prod]) + SHARED_DEPS[:prod]
157
166
  }
158
167
  [rspack_deps, webpack_deps]
159
168
  else
160
- [DEFAULT_RSPACK_DEPS, DEFAULT_WEBPACK_DEPS]
169
+ rspack_with_shared = {
170
+ dev: DEFAULT_RSPACK_DEPS[:dev] + SHARED_DEPS[:dev],
171
+ prod: DEFAULT_RSPACK_DEPS[:prod] + SHARED_DEPS[:prod]
172
+ }
173
+ webpack_with_shared = {
174
+ dev: DEFAULT_WEBPACK_DEPS[:dev] + SHARED_DEPS[:dev],
175
+ prod: DEFAULT_WEBPACK_DEPS[:prod] + SHARED_DEPS[:prod]
176
+ }
177
+ [rspack_with_shared, webpack_with_shared]
161
178
  end
162
179
  end
163
180
 
@@ -234,7 +251,13 @@ module Shakapacker
234
251
  def manage_dependencies(bundler, install_deps, switching: true, no_uninstall: false)
235
252
  rspack_deps, webpack_deps = load_dependencies
236
253
  deps_to_install = bundler == "rspack" ? rspack_deps : webpack_deps
237
- deps_to_remove = bundler == "rspack" ? webpack_deps : rspack_deps
254
+ old_bundler_deps = bundler == "rspack" ? webpack_deps : rspack_deps
255
+
256
+ # Remove shared dependencies from removal list
257
+ deps_to_remove = {
258
+ dev: old_bundler_deps[:dev] - SHARED_DEPS[:dev],
259
+ prod: old_bundler_deps[:prod] - SHARED_DEPS[:prod]
260
+ }
238
261
 
239
262
  if install_deps
240
263
  puts ""
@@ -277,15 +300,13 @@ module Shakapacker
277
300
  def remove_dependencies(deps)
278
301
  package_json = get_package_json
279
302
 
280
- unless deps[:dev].empty?
281
- unless package_json.manager.remove(deps[:dev])
282
- puts " ⚠️ Warning: Failed to uninstall some dev dependencies"
283
- end
284
- end
303
+ # Combine dev and prod dependencies into a single list for removal
304
+ # Package managers remove packages from both dependencies and devDependencies sections if present
305
+ all_deps = deps[:dev] + deps[:prod]
285
306
 
286
- unless deps[:prod].empty?
287
- unless package_json.manager.remove(deps[:prod])
288
- puts " ⚠️ Warning: Failed to uninstall some prod dependencies"
307
+ unless all_deps.empty?
308
+ unless package_json.manager.remove(all_deps)
309
+ puts " ⚠️ Warning: Failed to uninstall some dependencies"
289
310
  end
290
311
  end
291
312
  end
@@ -1,4 +1,4 @@
1
1
  module Shakapacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "9.3.2".freeze
3
+ VERSION = "9.3.4.beta.0".freeze
4
4
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shakapacker",
3
- "version": "9.3.2",
3
+ "version": "9.3.4-beta.0",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "homepage": "https://github.com/shakacode/shakapacker",
6
6
  "bugs": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shakapacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.2
4
+ version: 9.3.4.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -389,7 +389,7 @@ homepage: https://github.com/shakacode/shakapacker
389
389
  licenses:
390
390
  - MIT
391
391
  metadata:
392
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.2
392
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v9.3.4.beta.0
393
393
  rdoc_options: []
394
394
  require_paths:
395
395
  - lib