shakapacker 6.4.0 → 6.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41d452e91baefc4e4235ab82c30a8a5fb6cfa98854016124f8214b8b2f475986
4
- data.tar.gz: '08fb5cd0691f29a12862b827d1fc247565300256e21ba2dead9a2e1d128cc2a2'
3
+ metadata.gz: c2ce3fcf970a230e5d52a78be7e8acd7b7bd11338a33a24f1d1ad55b6636ff3c
4
+ data.tar.gz: 239818a24f0db0e7239a2d114f387b0e3990127350b3e900ee8c2e358fa800dc
5
5
  SHA512:
6
- metadata.gz: c39f8cd91ea7a0a786341ddbc115d91c30dee7826914c0fcb85ab1f9e52b0719706b4d7343922184f8beefaa20de7fa7d7fa760a36bb06e2f73c38a6d965d792
7
- data.tar.gz: c70a8973e7f69d60ceab67055b6c597b8ace1ba72137b2dc4a3902f9e3fae71f393aaa4dc82f5253f57c3e559b56b0d2a12f4f3234f0249c234b8f3106162b3c
6
+ metadata.gz: b587960642b7351b54a429dcff2230d0fc08aba1cd8c48d9460c19c981d29262d6e1010d07ebaddaf96f7b1f0154de7b9b99c5263b75f7207c1ee9c647b9941c
7
+ data.tar.gz: 2574d2356fc023d4a7747c3e4f594042c85553d7c8b429fda2a6fe76e0a87e67fdb8bb478ed5c4267541dfb38b599c0af6c760b417df44b7f4ae6a6337ec7c66
data/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ Changes since last non-beta release.
8
8
 
9
9
  _Please add entries here for your pull requests that are not yet released._
10
10
 
11
+ ## [v6.4.1] - June 5, 2022
12
+ ### Fixed
13
+ - Restores automatic installation of yarn packages removed in [#131](https://github.com/shakacode/shakapacker/pull/131), with added deprecation notice. [PR 140](https://github.com/shakacode/shakapacker/pull/140) by [tomdracz](https://github.com/tomdracz).
14
+
15
+ This will be again removed in Shakapacker v7 so you need to ensure you are installing yarn packages explicitly before the asset compilation, rather than relying on this behaviour through `asset:precompile` task (e.g. Capistrano deployment).
16
+
17
+ - Disable Spring being used by `rails-erb-loader`. [PR 141](https://github.com/shakacode/shakapacker/pull/141) by [tomdracz](https://github.com/tomdracz).
18
+
11
19
  ## [v6.4.0] - June 2, 2022
12
20
  ### Fixed
13
21
  - Fixed [Issue 123: Rails 7.0.3 - Webpacker configuration file not found when running rails webpacker:install (shakapacker v6.3)](https://github.com/shakacode/shakapacker/issues/123) in [PR 136: Don't enhance precompile if no config #136](https://github.com/shakacode/shakapacker/pull/136) by [justin808](https://github.com/justin808).
@@ -137,7 +145,8 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
137
145
  ## v5.4.3 and prior changes from rails/webpacker
138
146
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
139
147
 
140
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.4.0...master
148
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.4.1...master
149
+ [v6.4.1]: https://github.com/shakacode/shakapacker/compare/v6.4.0...v6.4.1
141
150
  [v6.4.0]: https://github.com/shakacode/shakapacker/compare/v6.3.0...v6.4.0
142
151
  [v6.3.0]: https://github.com/shakacode/shakapacker/compare/v6.2.1...v6.3.0
143
152
  [v6.2.1]: https://github.com/shakacode/shakapacker/compare/v6.2.0...v6.2.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shakapacker (6.3.0)
4
+ shakapacker (6.4.0)
5
5
  activesupport (>= 5.2)
6
6
  rack-proxy (>= 0.6.1)
7
7
  railties (>= 5.2)
@@ -99,8 +99,8 @@ GEM
99
99
  racc (~> 1.4)
100
100
  nokogiri (1.13.6-x86_64-linux)
101
101
  racc (~> 1.4)
102
- parallel (1.21.0)
103
- parser (3.0.2.0)
102
+ parallel (1.22.1)
103
+ parser (3.1.2.0)
104
104
  ast (~> 2.4.1)
105
105
  racc (1.6.0)
106
106
  rack (2.2.3.1)
@@ -134,21 +134,21 @@ GEM
134
134
  method_source
135
135
  rake (>= 12.2)
136
136
  thor (~> 1.0)
137
- rainbow (3.0.0)
137
+ rainbow (3.1.1)
138
138
  rake (13.0.6)
139
- regexp_parser (2.1.1)
139
+ regexp_parser (2.5.0)
140
140
  rexml (3.2.5)
141
- rubocop (1.21.0)
141
+ rubocop (1.30.0)
142
142
  parallel (~> 1.10)
143
- parser (>= 3.0.0.0)
143
+ parser (>= 3.1.0.0)
144
144
  rainbow (>= 2.2.2, < 4.0)
145
145
  regexp_parser (>= 1.8, < 3.0)
146
- rexml
147
- rubocop-ast (>= 1.9.1, < 2.0)
146
+ rexml (>= 3.2.5, < 4.0)
147
+ rubocop-ast (>= 1.18.0, < 2.0)
148
148
  ruby-progressbar (~> 1.7)
149
149
  unicode-display_width (>= 1.4.0, < 3.0)
150
- rubocop-ast (1.11.0)
151
- parser (>= 3.0.1.1)
150
+ rubocop-ast (1.18.0)
151
+ parser (>= 3.1.1.0)
152
152
  rubocop-performance (1.11.5)
153
153
  rubocop (>= 1.7.0, < 2.0)
154
154
  rubocop-ast (>= 0.4.0)
@@ -1,8 +1,16 @@
1
1
  $stdout.sync = true
2
2
 
3
+ def yarn_install_available?
4
+ rails_major = Rails::VERSION::MAJOR
5
+ rails_minor = Rails::VERSION::MINOR
6
+
7
+ rails_major > 5 || (rails_major == 5 && rails_minor >= 1)
8
+ end
9
+
3
10
  def enhance_assets_precompile
4
11
  # yarn:install was added in Rails 5.1
5
- Rake::Task["assets:precompile"].enhance do |task|
12
+ deps = yarn_install_available? ? [] : ["webpacker:yarn_install"]
13
+ Rake::Task["assets:precompile"].enhance(deps) do |task|
6
14
  prefix = task.name.split(/#|assets:precompile/).first
7
15
 
8
16
  Rake::Task["#{prefix}webpacker:compile"].invoke
@@ -29,6 +37,6 @@ if Webpacker.config.webpacker_precompile?
29
37
  if Rake::Task.task_defined?("assets:precompile")
30
38
  enhance_assets_precompile
31
39
  else
32
- Rake::Task.define_task("assets:precompile" => ["webpacker:compile"])
40
+ Rake::Task.define_task("assets:precompile" => ["webpacker:yarn_install", "webpacker:compile"])
33
41
  end
34
42
  end
@@ -0,0 +1,24 @@
1
+ namespace :webpacker do
2
+ desc "Support for older Rails versions. Install all JavaScript dependencies as specified via Yarn"
3
+ task :yarn_install do
4
+ warn <<~MSG.strip
5
+ Shakapacker - Automatic installation of yarn packages is deprecated
6
+ Automatic installation of yarn packages when assets are precompiled is deprecated and will be removed in Shakapacker v7.
7
+ Please ensure you are installing yarn packages explicitly before the asset compilation.
8
+ MSG
9
+
10
+ valid_node_envs = %w[test development production]
11
+ node_env = ENV.fetch("NODE_ENV") do
12
+ valid_node_envs.include?(Rails.env) ? Rails.env : "production"
13
+ end
14
+ Dir.chdir(Rails.root) do
15
+ yarn_flags =
16
+ if `yarn --version`.start_with?("1")
17
+ "--no-progress --frozen-lockfile"
18
+ else
19
+ "--immutable"
20
+ end
21
+ system({ "NODE_ENV" => node_env }, "yarn install #{yarn_flags}")
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Duplicate of the yarn tasks still present in Rails until Webpacker <5 have been deprecated
4
+
5
+ namespace :yarn do
6
+ desc "Install all JavaScript dependencies as specified via Yarn"
7
+ task :install do
8
+ warn <<~MSG.strip
9
+ Shakapacker - Automatic installation of yarn packages is deprecated
10
+ Automatic installation of yarn packages when assets are precompiled is deprecated and will be removed in Shakapacker v7.
11
+ Please ensure you are installing yarn packages explicitly before the asset compilation.
12
+ MSG
13
+
14
+ begin
15
+ # Install only production deps when for not usual envs.
16
+ valid_node_envs = %w[test development production]
17
+ node_env = ENV.fetch("NODE_ENV") do
18
+ valid_node_envs.include?(Rails.env) ? Rails.env : "production"
19
+ end
20
+
21
+ yarn_flags =
22
+ if `#{RbConfig.ruby} "#{Rails.root}/bin/yarn" --version`.start_with?("1")
23
+ "--no-progress --frozen-lockfile"
24
+ else
25
+ "--immutable"
26
+ end
27
+
28
+ system(
29
+ { "NODE_ENV" => node_env },
30
+ "#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}",
31
+ exception: true
32
+ )
33
+ rescue Errno::ENOENT
34
+ $stderr.puts "bin/yarn was not found."
35
+ $stderr.puts "Please run `bundle exec rails app:update:bin` to create it."
36
+ exit 1
37
+ end
38
+ end
39
+ end
40
+
41
+ # Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
42
+ if Rake::Task.task_defined?("assets:precompile") && File.exist?(Rails.root.join("bin", "yarn"))
43
+ Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
44
+ end
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.4.0".freeze
3
+ VERSION = "6.4.1".freeze
4
4
  end
data/package/rules/erb.js CHANGED
@@ -9,7 +9,13 @@ module.exports = canProcess('rails-erb-loader', (resolvedPath) => ({
9
9
  use: [
10
10
  {
11
11
  loader: resolvedPath,
12
- options: { runner: `${runner}bin/rails runner` }
12
+ options: {
13
+ runner: `${runner}bin/rails runner`,
14
+ env: {
15
+ ...process.env,
16
+ DISABLE_SPRING: 1
17
+ }
18
+ }
13
19
  }
14
20
  ]
15
21
  }))
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shakapacker",
3
- "version": "6.4.0",
3
+ "version": "6.4.1",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "main": "package/index.js",
6
6
  "files": [
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: 6.4.0
4
+ version: 6.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-06-03 00:00:00.000000000 Z
13
+ date: 2022-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -178,6 +178,8 @@ files:
178
178
  - lib/tasks/webpacker/install.rake
179
179
  - lib/tasks/webpacker/verify_config.rake
180
180
  - lib/tasks/webpacker/verify_install.rake
181
+ - lib/tasks/webpacker/yarn_install.rake
182
+ - lib/tasks/yarn.rake
181
183
  - lib/webpacker.rb
182
184
  - lib/webpacker/base_strategy.rb
183
185
  - lib/webpacker/commands.rb
@@ -301,7 +303,7 @@ homepage: https://github.com/shakacode/shakapacker
301
303
  licenses:
302
304
  - MIT
303
305
  metadata:
304
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.4.0
306
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.4.1
305
307
  post_install_message:
306
308
  rdoc_options: []
307
309
  require_paths: