shakapacker 6.2.1 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +53 -4
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +2 -1
- data/Gemfile.lock +84 -74
- data/README.md +172 -65
- data/docs/react.md +262 -0
- data/docs/sprockets.md +10 -0
- data/docs/v6_upgrade.md +1 -1
- data/lib/install/config/webpacker.yml +14 -0
- data/lib/tasks/webpacker/clean.rake +1 -3
- data/lib/tasks/webpacker/clobber.rake +1 -3
- data/lib/tasks/webpacker/compile.rake +3 -14
- data/lib/tasks/webpacker.rake +0 -1
- data/lib/webpacker/base_strategy.rb +24 -0
- data/lib/webpacker/compiler.rb +4 -67
- data/lib/webpacker/compiler_strategy.rb +20 -0
- data/lib/webpacker/configuration.rb +13 -0
- data/lib/webpacker/digest_strategy.rb +59 -0
- data/lib/webpacker/helper.rb +26 -1
- data/lib/webpacker/instance.rb +4 -0
- data/lib/webpacker/manifest.rb +2 -2
- data/lib/webpacker/mtime_strategy.rb +40 -0
- data/lib/webpacker/version.rb +1 -1
- data/package/babel/preset.js +0 -1
- data/package/environments/__tests__/base.js +30 -3
- data/package/environments/base.js +8 -1
- data/package/rules/file.js +2 -2
- data/package.json +13 -12
- data/test/compiler_strategy_test.rb +27 -0
- data/test/compiler_test.rb +26 -34
- data/test/configuration_test.rb +24 -4
- data/test/digest_strategy_test.rb +33 -0
- data/test/helper_test.rb +22 -0
- data/test/manifest_test.rb +3 -3
- data/test/mtime_strategy_test.rb +42 -0
- data/test/rake_tasks_test.rb +0 -34
- data/test/test_app/app/packs/entrypoints/generated/something.js +2 -0
- data/test/test_app/config/webpacker.yml +1 -0
- data/test/test_app/config/webpacker_nested_entries.yml +83 -0
- data/test/test_app/config/webpacker_no_precompile.yml +7 -0
- data/yarn.lock +917 -884
- metadata +21 -5
- data/lib/tasks/webpacker/yarn_install.rake +0 -18
- data/lib/tasks/yarn.rake +0 -38
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
|
+
version: 6.4.0
|
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-
|
13
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -142,6 +142,8 @@ files:
|
|
142
142
|
- docs/customizing_babel_config.md
|
143
143
|
- docs/deployment.md
|
144
144
|
- docs/developing_webpacker.md
|
145
|
+
- docs/react.md
|
146
|
+
- docs/sprockets.md
|
145
147
|
- docs/style_loader_vs_mini_css.md
|
146
148
|
- docs/troubleshooting.md
|
147
149
|
- docs/using_esbuild_loader.md
|
@@ -176,19 +178,21 @@ files:
|
|
176
178
|
- lib/tasks/webpacker/install.rake
|
177
179
|
- lib/tasks/webpacker/verify_config.rake
|
178
180
|
- lib/tasks/webpacker/verify_install.rake
|
179
|
-
- lib/tasks/webpacker/yarn_install.rake
|
180
|
-
- lib/tasks/yarn.rake
|
181
181
|
- lib/webpacker.rb
|
182
|
+
- lib/webpacker/base_strategy.rb
|
182
183
|
- lib/webpacker/commands.rb
|
183
184
|
- lib/webpacker/compiler.rb
|
185
|
+
- lib/webpacker/compiler_strategy.rb
|
184
186
|
- lib/webpacker/configuration.rb
|
185
187
|
- lib/webpacker/dev_server.rb
|
186
188
|
- lib/webpacker/dev_server_proxy.rb
|
187
189
|
- lib/webpacker/dev_server_runner.rb
|
190
|
+
- lib/webpacker/digest_strategy.rb
|
188
191
|
- lib/webpacker/env.rb
|
189
192
|
- lib/webpacker/helper.rb
|
190
193
|
- lib/webpacker/instance.rb
|
191
194
|
- lib/webpacker/manifest.rb
|
195
|
+
- lib/webpacker/mtime_strategy.rb
|
192
196
|
- lib/webpacker/railtie.rb
|
193
197
|
- lib/webpacker/runner.rb
|
194
198
|
- lib/webpacker/version.rb
|
@@ -236,10 +240,12 @@ files:
|
|
236
240
|
- package/utils/helpers.js
|
237
241
|
- rakelib/release.rake
|
238
242
|
- test/command_test.rb
|
243
|
+
- test/compiler_strategy_test.rb
|
239
244
|
- test/compiler_test.rb
|
240
245
|
- test/configuration_test.rb
|
241
246
|
- test/dev_server_runner_test.rb
|
242
247
|
- test/dev_server_test.rb
|
248
|
+
- test/digest_strategy_test.rb
|
243
249
|
- test/engine_rake_tasks_test.rb
|
244
250
|
- test/env_test.rb
|
245
251
|
- test/fixtures/beta_package.json
|
@@ -261,9 +267,11 @@ files:
|
|
261
267
|
- test/mounted_app/test/dummy/config/environment.rb
|
262
268
|
- test/mounted_app/test/dummy/config/webpacker.yml
|
263
269
|
- test/mounted_app/test/dummy/package.json
|
270
|
+
- test/mtime_strategy_test.rb
|
264
271
|
- test/rake_tasks_test.rb
|
265
272
|
- test/test_app/Rakefile
|
266
273
|
- test/test_app/app/packs/entrypoints/application.js
|
274
|
+
- test/test_app/app/packs/entrypoints/generated/something.js
|
267
275
|
- test/test_app/app/packs/entrypoints/multi_entry.css
|
268
276
|
- test/test_app/app/packs/entrypoints/multi_entry.js
|
269
277
|
- test/test_app/bin/webpacker
|
@@ -275,6 +283,8 @@ files:
|
|
275
283
|
- test/test_app/config/webpack/webpack.config.js
|
276
284
|
- test/test_app/config/webpacker.yml
|
277
285
|
- test/test_app/config/webpacker_manifest_path.yml
|
286
|
+
- test/test_app/config/webpacker_nested_entries.yml
|
287
|
+
- test/test_app/config/webpacker_no_precompile.yml
|
278
288
|
- test/test_app/config/webpacker_other_location.yml
|
279
289
|
- test/test_app/config/webpacker_public_root.yml
|
280
290
|
- test/test_app/package.json
|
@@ -291,7 +301,7 @@ homepage: https://github.com/shakacode/shakapacker
|
|
291
301
|
licenses:
|
292
302
|
- MIT
|
293
303
|
metadata:
|
294
|
-
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.
|
304
|
+
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.4.0
|
295
305
|
post_install_message:
|
296
306
|
rdoc_options: []
|
297
307
|
require_paths:
|
@@ -313,10 +323,12 @@ specification_version: 4
|
|
313
323
|
summary: Use webpack to manage app-like JavaScript modules in Rails
|
314
324
|
test_files:
|
315
325
|
- test/command_test.rb
|
326
|
+
- test/compiler_strategy_test.rb
|
316
327
|
- test/compiler_test.rb
|
317
328
|
- test/configuration_test.rb
|
318
329
|
- test/dev_server_runner_test.rb
|
319
330
|
- test/dev_server_test.rb
|
331
|
+
- test/digest_strategy_test.rb
|
320
332
|
- test/engine_rake_tasks_test.rb
|
321
333
|
- test/env_test.rb
|
322
334
|
- test/fixtures/beta_package.json
|
@@ -338,9 +350,11 @@ test_files:
|
|
338
350
|
- test/mounted_app/test/dummy/config/environment.rb
|
339
351
|
- test/mounted_app/test/dummy/config/webpacker.yml
|
340
352
|
- test/mounted_app/test/dummy/package.json
|
353
|
+
- test/mtime_strategy_test.rb
|
341
354
|
- test/rake_tasks_test.rb
|
342
355
|
- test/test_app/Rakefile
|
343
356
|
- test/test_app/app/packs/entrypoints/application.js
|
357
|
+
- test/test_app/app/packs/entrypoints/generated/something.js
|
344
358
|
- test/test_app/app/packs/entrypoints/multi_entry.css
|
345
359
|
- test/test_app/app/packs/entrypoints/multi_entry.js
|
346
360
|
- test/test_app/bin/webpacker
|
@@ -352,6 +366,8 @@ test_files:
|
|
352
366
|
- test/test_app/config/webpack/webpack.config.js
|
353
367
|
- test/test_app/config/webpacker.yml
|
354
368
|
- test/test_app/config/webpacker_manifest_path.yml
|
369
|
+
- test/test_app/config/webpacker_nested_entries.yml
|
370
|
+
- test/test_app/config/webpacker_no_precompile.yml
|
355
371
|
- test/test_app/config/webpacker_other_location.yml
|
356
372
|
- test/test_app/config/webpacker_public_root.yml
|
357
373
|
- test/test_app/package.json
|
@@ -1,18 +0,0 @@
|
|
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
|
-
valid_node_envs = %w[test development production]
|
5
|
-
node_env = ENV.fetch("NODE_ENV") do
|
6
|
-
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
7
|
-
end
|
8
|
-
Dir.chdir(Rails.root) do
|
9
|
-
yarn_flags =
|
10
|
-
if `yarn --version`.start_with?("1")
|
11
|
-
"--no-progress --frozen-lockfile"
|
12
|
-
else
|
13
|
-
"--immutable"
|
14
|
-
end
|
15
|
-
system({ "NODE_ENV" => node_env }, "yarn install #{yarn_flags}")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/tasks/yarn.rake
DELETED
@@ -1,38 +0,0 @@
|
|
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
|
-
begin
|
9
|
-
# Install only production deps when for not usual envs.
|
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
|
-
|
15
|
-
yarn_flags =
|
16
|
-
if `#{RbConfig.ruby} "#{Rails.root}/bin/yarn" --version`.start_with?("1")
|
17
|
-
"--no-progress --frozen-lockfile"
|
18
|
-
else
|
19
|
-
"--immutable"
|
20
|
-
end
|
21
|
-
|
22
|
-
system(
|
23
|
-
{ "NODE_ENV" => node_env },
|
24
|
-
"#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}",
|
25
|
-
exception: true
|
26
|
-
)
|
27
|
-
rescue Errno::ENOENT
|
28
|
-
$stderr.puts "bin/yarn was not found."
|
29
|
-
$stderr.puts "Please run `bundle exec rails app:update:bin` to create it."
|
30
|
-
exit 1
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
|
36
|
-
if Rake::Task.task_defined?("assets:precompile") && File.exist?(Rails.root.join("bin", "yarn"))
|
37
|
-
Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
|
38
|
-
end
|