webpacker-pnpm 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +4 -3
  3. data/.gitignore +3 -5
  4. data/.rubocop.yml +19 -0
  5. data/CHANGELOG.md +7 -0
  6. data/README.md +14 -3
  7. data/lib/webpacker/pnpm/patches.rb +25 -3
  8. data/lib/webpacker/pnpm/railtie.rb +2 -1
  9. data/lib/webpacker/pnpm/version.rb +1 -1
  10. data/test_app/.gitignore +6 -0
  11. data/test_app/Gemfile +5 -0
  12. data/test_app/Gemfile.lock +175 -0
  13. data/{Rakefile → test_app/Rakefile} +2 -1
  14. data/test_app/app/javascript/packs/application.js +10 -0
  15. data/{test/test_app → test_app}/app/javascript/packs/multi_entry.css +0 -0
  16. data/{test/test_app → test_app}/app/javascript/packs/multi_entry.js +0 -0
  17. data/{test/test_app → test_app}/bin/rails +0 -0
  18. data/{test/test_app → test_app}/bin/rake +0 -0
  19. data/{test/test_app → test_app}/bin/setup +0 -0
  20. data/{test/test_app → test_app}/bin/webpack +0 -0
  21. data/{test/test_app → test_app}/bin/webpack-dev-server +0 -0
  22. data/{test/test_app → test_app}/config/application.rb +0 -0
  23. data/{test/test_app → test_app}/config/boot.rb +0 -0
  24. data/{test/test_app → test_app}/config/environment.rb +0 -0
  25. data/{test/test_app → test_app}/config/webpack/development.js +0 -0
  26. data/{test/test_app → test_app}/config/webpack/environment.js +0 -0
  27. data/test_app/config/webpack/production.js +0 -0
  28. data/{test/test_app → test_app}/config/webpacker.yml +0 -0
  29. data/{test/test_app → test_app}/config/webpacker_public_root.yml +0 -0
  30. data/{test/test_app → test_app}/config.ru +0 -0
  31. data/{test/test_app → test_app}/package.json +3 -1
  32. data/test_app/pnpm-lock.yaml +6756 -0
  33. data/{test/test_app → test_app}/public/packs/manifest.json +0 -0
  34. data/test_app/src/index.js +0 -0
  35. data/{test → test_app/test}/rake_tasks_test.rb +14 -3
  36. data/{test → test_app/test}/test_helper.rb +1 -1
  37. data/webpacker-pnpm.gemspec +1 -1
  38. metadata +36 -56
  39. data/test/test_app/.gitignore +0 -7
  40. data/test/test_app/Rakefile +0 -5
  41. data/test/test_app/app/javascript/packs/application.js +0 -10
  42. data/test/test_app/pnpm-lock.yaml +0 -20
File without changes
@@ -18,7 +18,7 @@ module Webpacker
18
18
  end
19
19
 
20
20
  def test_check_pnpm_version
21
- output = chdir_concurrent(test_path, "rake webpacker:check_pnpm")
21
+ output = chdir_concurrent(test_path, "bundle exec rake webpacker:check_pnpm")
22
22
  assert_not_includes(output, "pnpm is not installed")
23
23
  assert_not_includes(output, "Webpacker requires pnpm")
24
24
 
@@ -26,7 +26,7 @@ module Webpacker
26
26
  end
27
27
 
28
28
  def test_override_check_yarn_version
29
- output = chdir_concurrent(test_path, "rake webpacker:check_yarn")
29
+ output = chdir_concurrent(test_path, "bundle exec rake webpacker:check_yarn")
30
30
  assert_not_includes(output, "pnpm is not installed")
31
31
  assert_not_includes(output, "Webpacker requires pnpm")
32
32
 
@@ -77,10 +77,21 @@ module Webpacker
77
77
  end
78
78
  end
79
79
 
80
+ def test_asset_precompile
81
+ cmd = "bundle exec rake assets:precompile"
82
+ output = chdir_concurrent(test_path, cmd, { "NODE_ENV": "production" },
83
+ { isolated: true })
84
+
85
+ assert_includes(output, "Compiling...")
86
+
87
+ assert_not_includes(output, "Compilation failed:")
88
+ assert_includes(output, "Compiled all packs in")
89
+ end
90
+
80
91
  private
81
92
 
82
93
  def test_path
83
- File.expand_path("test_app", __dir__)
94
+ File.expand_path(".")
84
95
  end
85
96
 
86
97
  def test_app_dev_dependencies
@@ -6,7 +6,7 @@ require "etc"
6
6
  require "fileutils"
7
7
  require "open3"
8
8
 
9
- require_relative "test_app/config/environment"
9
+ require_relative "../config/environment"
10
10
 
11
11
  Rails.env = "production"
12
12
  Webpacker.instance = ::Webpacker::Instance.new
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "rails", ">= 5.2"
31
31
  spec.add_dependency "rake", ">= 12.3.3"
32
32
  spec.add_dependency "semantic_range", "~> 2.3"
33
- spec.add_dependency "webpacker", "~> 5.0"
33
+ spec.add_dependency "webpacker"
34
34
 
35
35
  spec.add_development_dependency "minitest", "~> 5.0"
36
36
  spec.add_development_dependency "practical-pig", "~> 1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacker-pnpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elias Gabriel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-14 00:00:00.000000000 Z
11
+ date: 2023-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: webpacker
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '5.0'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '5.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +167,6 @@ files:
167
167
  - Gemfile
168
168
  - LICENSE
169
169
  - README.md
170
- - Rakefile
171
170
  - bin/console
172
171
  - bin/setup
173
172
  - gemfiles/Gemfile-rails.5.2.x
@@ -179,37 +178,41 @@ files:
179
178
  - lib/webpacker/tasks/check_pnpm.rake
180
179
  - lib/webpacker/tasks/env.rake
181
180
  - lib/webpacker/tasks/pnpm_install.rake
182
- - test/rake_tasks_test.rb
183
- - test/test_app/.gitignore
184
- - test/test_app/Rakefile
185
- - test/test_app/app/javascript/packs/application.js
186
- - test/test_app/app/javascript/packs/multi_entry.css
187
- - test/test_app/app/javascript/packs/multi_entry.js
188
- - test/test_app/bin/rails
189
- - test/test_app/bin/rake
190
- - test/test_app/bin/setup
191
- - test/test_app/bin/webpack
192
- - test/test_app/bin/webpack-dev-server
193
- - test/test_app/config.ru
194
- - test/test_app/config/application.rb
195
- - test/test_app/config/boot.rb
196
- - test/test_app/config/environment.rb
197
- - test/test_app/config/webpack/development.js
198
- - test/test_app/config/webpack/environment.js
199
- - test/test_app/config/webpacker.yml
200
- - test/test_app/config/webpacker_public_root.yml
201
- - test/test_app/package.json
202
- - test/test_app/pnpm-lock.yaml
203
- - test/test_app/public/packs/manifest.json
204
- - test/test_helper.rb
181
+ - test_app/.gitignore
182
+ - test_app/Gemfile
183
+ - test_app/Gemfile.lock
184
+ - test_app/Rakefile
185
+ - test_app/app/javascript/packs/application.js
186
+ - test_app/app/javascript/packs/multi_entry.css
187
+ - test_app/app/javascript/packs/multi_entry.js
188
+ - test_app/bin/rails
189
+ - test_app/bin/rake
190
+ - test_app/bin/setup
191
+ - test_app/bin/webpack
192
+ - test_app/bin/webpack-dev-server
193
+ - test_app/config.ru
194
+ - test_app/config/application.rb
195
+ - test_app/config/boot.rb
196
+ - test_app/config/environment.rb
197
+ - test_app/config/webpack/development.js
198
+ - test_app/config/webpack/environment.js
199
+ - test_app/config/webpack/production.js
200
+ - test_app/config/webpacker.yml
201
+ - test_app/config/webpacker_public_root.yml
202
+ - test_app/package.json
203
+ - test_app/pnpm-lock.yaml
204
+ - test_app/public/packs/manifest.json
205
+ - test_app/src/index.js
206
+ - test_app/test/rake_tasks_test.rb
207
+ - test_app/test/test_helper.rb
205
208
  - webpacker-pnpm.gemspec
206
209
  homepage: https://github.com/thearchitector/webpacker-pnpm
207
210
  licenses:
208
211
  - BSD-3-Clause
209
212
  metadata:
210
213
  homepage_uri: https://github.com/thearchitector/webpacker-pnpm
211
- source_code_uri: https://github.com/thearchitector/webpacker-pnpm/tree/v1.2.2
212
- changelog_uri: https://github.com/thearchitector/webpacker-pnpm/blob/v1.2.2/CHANGELOG.md
214
+ source_code_uri: https://github.com/thearchitector/webpacker-pnpm/tree/v1.2.3
215
+ changelog_uri: https://github.com/thearchitector/webpacker-pnpm/blob/v1.2.3/CHANGELOG.md
213
216
  bug_tracker_uri: https://github.com/thearchitector/webpacker-pnpm/issues
214
217
  post_install_message:
215
218
  rdoc_options: []
@@ -230,27 +233,4 @@ rubygems_version: 3.0.3
230
233
  signing_key:
231
234
  specification_version: 4
232
235
  summary: Replaces Webpacker's Yarn environment with pnpm.
233
- test_files:
234
- - test/rake_tasks_test.rb
235
- - test/test_app/.gitignore
236
- - test/test_app/Rakefile
237
- - test/test_app/app/javascript/packs/application.js
238
- - test/test_app/app/javascript/packs/multi_entry.css
239
- - test/test_app/app/javascript/packs/multi_entry.js
240
- - test/test_app/bin/rails
241
- - test/test_app/bin/rake
242
- - test/test_app/bin/setup
243
- - test/test_app/bin/webpack
244
- - test/test_app/bin/webpack-dev-server
245
- - test/test_app/config.ru
246
- - test/test_app/config/application.rb
247
- - test/test_app/config/boot.rb
248
- - test/test_app/config/environment.rb
249
- - test/test_app/config/webpack/development.js
250
- - test/test_app/config/webpack/environment.js
251
- - test/test_app/config/webpacker.yml
252
- - test/test_app/config/webpacker_public_root.yml
253
- - test/test_app/package.json
254
- - test/test_app/pnpm-lock.yaml
255
- - test/test_app/public/packs/manifest.json
256
- - test/test_helper.rb
236
+ test_files: []
@@ -1,7 +0,0 @@
1
- /.bundle/
2
- /coverage/
3
- /doc/
4
- /pkg/
5
- /spec/reports/
6
- /tmp/
7
- /node_modules
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "config/application"
4
-
5
- Rails.application.load_tasks
@@ -1,10 +0,0 @@
1
- /* eslint no-console:0 */
2
- // This file is automatically compiled by Webpack, along with any other files
3
- // present in this directory. You're encouraged to place your actual application logic in
4
- // a relevant structure within app/javascript and only use these pack files to reference
5
- // that code so it'll be compiled.
6
- //
7
- // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
8
- // layout file, like app/views/layouts/application.html.erb
9
-
10
- console.log('"Hello Sanity" from webpacker-pnpm!')
@@ -1,20 +0,0 @@
1
- dependencies:
2
- left-pad: 1.3.0
3
- devDependencies:
4
- right-pad: 1.0.1
5
- lockfileVersion: 5.1
6
- packages:
7
- /left-pad/1.3.0:
8
- deprecated: use String.prototype.padStart()
9
- dev: false
10
- resolution:
11
- integrity: sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
12
- /right-pad/1.0.1:
13
- dev: true
14
- engines:
15
- node: '>= 0.10'
16
- resolution:
17
- integrity: sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA=
18
- specifiers:
19
- left-pad: ^1.2.0
20
- right-pad: ^1.0.1