webpacker-pnpm 1.2.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 +7 -0
- data/.gitattributes +1 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +91 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +45 -0
- data/Gemfile +17 -0
- data/README.md +35 -0
- data/Rakefile +11 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/gemfiles/Gemfile-rails-edge +12 -0
- data/gemfiles/Gemfile-rails.5.2.x +9 -0
- data/gemfiles/Gemfile-rails.6.0.x +9 -0
- data/lib/webpacker/pnpm.rb +5 -0
- data/lib/webpacker/pnpm/patches.rb +53 -0
- data/lib/webpacker/pnpm/railtie.rb +24 -0
- data/lib/webpacker/pnpm/version.rb +7 -0
- data/lib/webpacker/tasks/check_pnpm.rake +27 -0
- data/lib/webpacker/tasks/env.rake +20 -0
- data/lib/webpacker/tasks/pnpm_install.rake +14 -0
- data/test/rake_tasks_test.rb +106 -0
- data/test/test_app/.gitignore +7 -0
- data/test/test_app/Rakefile +5 -0
- data/test/test_app/app/javascript/packs/application.js +10 -0
- data/test/test_app/app/javascript/packs/multi_entry.css +4 -0
- data/test/test_app/app/javascript/packs/multi_entry.js +4 -0
- data/test/test_app/bin/rails +6 -0
- data/test/test_app/bin/rake +6 -0
- data/test/test_app/bin/setup +27 -0
- data/test/test_app/bin/webpack +14 -0
- data/test/test_app/bin/webpack-dev-server +14 -0
- data/test/test_app/config.ru +7 -0
- data/test/test_app/config/application.rb +13 -0
- data/test/test_app/config/boot.rb +0 -0
- data/test/test_app/config/environment.rb +6 -0
- data/test/test_app/config/webpack/development.js +0 -0
- data/test/test_app/config/webpack/environment.js +3 -0
- data/test/test_app/config/webpacker.yml +96 -0
- data/test/test_app/config/webpacker_public_root.yml +19 -0
- data/test/test_app/package.json +13 -0
- data/test/test_app/pnpm-lock.yaml +20 -0
- data/test/test_app/public/packs/manifest.json +31 -0
- data/test/test_helper.rb +64 -0
- data/webpacker-pnpm.gemspec +36 -0
- metadata +226 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9e0c39889bfdad4a14a2fc35250e7eaa33fd49bf48ecc082c44d1985884fbe89
|
4
|
+
data.tar.gz: 8f27fae2d742a2b4c27e0fa675480dda85771bfd120e283fa706c80ce7414fa5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8715f49514245b10d8ed85169c5edadcb2ab8905880f9afdd273121835336c175dec087f05b639179024eeea4fc1745ca24c73d00c24fc92d06bbb85ab591d02
|
7
|
+
data.tar.gz: fd7a0f6cc602c9a7d4ba0a2689fc87feae4d7f93c470c9c5fc8b7f62cfd364fd3152839448150a58c523a0e516aa229eed3d9d07cc1083ed0b4ecaeb9938a5b8
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* text=lf
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
require: rubocop-rails
|
2
|
+
AllCops:
|
3
|
+
Exclude:
|
4
|
+
- "node_modules/**/*"
|
5
|
+
|
6
|
+
# disable length length checking, as it tends to make things worse in the majority
|
7
|
+
# of cases. however, it is good practice keep lines <= 85 columns so they remain
|
8
|
+
# readable.
|
9
|
+
Layout/LineLength:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# disable documentation checking. many classes do not require top-level comments,
|
13
|
+
# and their inclusion can actually obscure their function.
|
14
|
+
Style/Documentation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# functionalization is important, but the Rails' idiom for returning key-value
|
18
|
+
# maps can raise a false alarm with the max line number (10). increase the value
|
19
|
+
# to something more reasonable given the circumstances.
|
20
|
+
Metrics/MethodLength:
|
21
|
+
Max: 20
|
22
|
+
ExcludedMethods:
|
23
|
+
- test_rake_tasks
|
24
|
+
|
25
|
+
# if you're specifying access modifiers, it is likely intentional. force RuboCop
|
26
|
+
# to trust your decision making.
|
27
|
+
Lint/UselessAccessModifier:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
# flag potential memory leaks, like when opening a file.
|
31
|
+
Style/AutoResourceCleanup:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
# single quotes are meant for single characters. double quotes are meant for
|
35
|
+
# strings, which are arrays of multiple characters. there are a whole host of
|
36
|
+
# other differences and functions; if you're creating a string, you nearly always
|
37
|
+
# should use double quotes.
|
38
|
+
#
|
39
|
+
# https://en.wikipedia.org/wiki/Delimiter#Bracket_delimiters
|
40
|
+
# Schwartz, Randal (2005). Learning Perl. ISBN 978-0-596-10105-3.
|
41
|
+
Style/StringLiterals:
|
42
|
+
Enabled: true
|
43
|
+
EnforcedStyle: double_quotes
|
44
|
+
|
45
|
+
# flags methods that violate the default ABC magnitude (15). The ABC metric
|
46
|
+
# quantizes the size of a method, and is calculated based on the number of
|
47
|
+
# assignment operations, possible execution branches, and number of conditionals.
|
48
|
+
#
|
49
|
+
# https://en.wikipedia.org/wiki/ABC_Software_Metric
|
50
|
+
Metrics/AbcSize:
|
51
|
+
Enabled: true
|
52
|
+
IgnoredMethods:
|
53
|
+
- test_rake_tasks
|
54
|
+
- chdir_concurrent
|
55
|
+
|
56
|
+
# this simply doesn't work in a cross-platform development environment. Bit
|
57
|
+
# flags across UNIX and Windows platforms are volatile, and thus there is no
|
58
|
+
# way to ensure this passes besides explicitly granting execute permissions
|
59
|
+
# in CI config (which would defeat the purpose).
|
60
|
+
Lint/ScriptPermission:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Layout/SpaceAroundMethodCallOperator:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Lint/RaiseException:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Lint/StructNewOverride:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Style/ExponentialNotation:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/HashEachMethods:
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/HashTransformKeys:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/HashTransformValues:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
Style/SlicingWithRange:
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Style/RescueModifier:
|
91
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
language: ruby
|
2
|
+
os: linux
|
3
|
+
dist: bionic
|
4
|
+
before_install:
|
5
|
+
- gem install rubygems-update && update_rubygems
|
6
|
+
- yes | rvm @global do gem install bundler -v 2.1.4 || true
|
7
|
+
rvm:
|
8
|
+
- 2.4.9
|
9
|
+
- 2.5.5
|
10
|
+
- 2.6.5
|
11
|
+
- 2.7.0
|
12
|
+
- ruby-head
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/Gemfile-rails.5.2.x
|
15
|
+
- gemfiles/Gemfile-rails.6.0.x
|
16
|
+
- gemfiles/Gemfile-rails-edge
|
17
|
+
cache:
|
18
|
+
bundler: true
|
19
|
+
npm: false
|
20
|
+
yarn: false
|
21
|
+
directories:
|
22
|
+
- node_modules
|
23
|
+
- "~/.pnpm-store"
|
24
|
+
|
25
|
+
install:
|
26
|
+
- bundle install --jobs 3 --retry 3
|
27
|
+
- nvm install 12
|
28
|
+
- node -v
|
29
|
+
- curl -L https://raw.githubusercontent.com/pnpm/self-installer/master/install.js | node
|
30
|
+
- pnpm config set store-dir ~/.pnpm-store
|
31
|
+
- pnpm install --frozen-lockfile
|
32
|
+
script:
|
33
|
+
- bundle exec rubocop
|
34
|
+
- bundle exec rake test
|
35
|
+
jobs:
|
36
|
+
allow_failures:
|
37
|
+
- gemfile: gemfiles/Gemfile-rails-edge
|
38
|
+
- rvm: ruby-head
|
39
|
+
exclude:
|
40
|
+
- rvm: 2.4.9
|
41
|
+
gemfile: gemfiles/Gemfile-rails-edge
|
42
|
+
- rvm: 2.5.5
|
43
|
+
gemfile: gemfiles/Gemfile-rails-edge
|
44
|
+
- rvm: 2.4.9
|
45
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on Keep a Changelog (<https://keepachangelog.com/en/1.0.0/>). This project adheres to Semantic Versioning (<https://semver.org/spec/v2.0.0.html>).
|
6
|
+
|
7
|
+
## [v1.2.0] - 2020-05-14
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Compatibility with Rails' Template API via command execution hooks and keyword substitution.
|
12
|
+
- Support for existing Yarn Rake task dependence through task aliasing and redirection.
|
13
|
+
- Additional Rake tasks to test injection and interception logic.
|
14
|
+
- Utility method for concurrent and scoped `chdir` calls.
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Gem dependencies to reflect up-to-date versions.
|
19
|
+
- RuboCop formatting rules to support latest versions of Ruby.
|
20
|
+
- Test application structure to allow application booting.
|
21
|
+
- Rake task tests to utilize concurrent `chdir` calls.
|
22
|
+
- Tests to support Rails <6.x `[bugfix]`.
|
23
|
+
- Tests to support Ruby 2.4.9 `[bugfix]`.
|
24
|
+
|
25
|
+
### Removed
|
26
|
+
|
27
|
+
- Webpacker git submodule as method for replacing default Rails' rake tasks.
|
28
|
+
- Dependence on a specific version of Webpacker.
|
29
|
+
|
30
|
+
## [v1.1.0] - 2020-04-19
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
- RuboCop formatting rules to more align with Rails' style guide.
|
35
|
+
- TypeScript installation tasks based on Webpacker v5.1.0.
|
36
|
+
- Rake tasks to extend ActiveSupport and utilize concurrent threading.
|
37
|
+
|
38
|
+
## [v1.0.0] - 2020-04-17
|
39
|
+
|
40
|
+
### Added
|
41
|
+
|
42
|
+
- Gem specifications and foundational files, generated by Bundler v2.0.2, for defining a Ruby gem.
|
43
|
+
- Hook into Rails' engine loader for conditional task loading.
|
44
|
+
- Tasks replacing Yarn with pnpm for Webpacker v5.0.1, included as a submodule.
|
45
|
+
- Test suite with dummy application.
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem "rack-proxy", require: false
|
7
|
+
gem "rails", ">= 5.2"
|
8
|
+
gem "rake", ">= 12.3.3"
|
9
|
+
gem "semantic_range", require: false
|
10
|
+
|
11
|
+
install_if -> { Gem.win_platform? } do
|
12
|
+
gem "tzinfo-data"
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem "minitest", ">= 5"
|
17
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# webpacker-pnpm
|
2
|
+
|
3
|
+

|
4
|
+
[](https://travis-ci.org/github/thearchitector/webpacker-pnpm)
|
5
|
+

|
6
|
+
[](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
7
|
+
|
8
|
+
`webpacker-pnpm` replaces Rails' Yarn environment with [pnpm](https://pnpm.js.org/), which is a much smarter, efficient, and faster alternative Node.js package manager. You can read about the philosophy and technology behind `pnpm` in [this convincing blog post](https://www.kochan.io/nodejs/why-should-we-use-pnpm.html) by Zoltan Kochan, but in essence it reduces dependency resolution times and `node_modules` folder sizes to within reasonable ranges (not 30 seconds and 10 GiB).
|
9
|
+
|
10
|
+
## Features
|
11
|
+
|
12
|
+
- Production-ready
|
13
|
+
- Drop-in seamless replacement for Yarn, no config required
|
14
|
+
- Supports Rails' Template API, including existing templates using Yarn
|
15
|
+
- Independent of official Webpacker versions
|
16
|
+
- Provides code sanity without the migraines
|
17
|
+
- Gives you more disk space
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
In order to use `webpacker-pnpm`, you must install `pnpm`. The official instructions are [here](https://pnpm.js.org/en/installation), but all they say is to run the following command:
|
22
|
+
|
23
|
+
```sh
|
24
|
+
$ curl -L https://raw.githubusercontent.com/pnpm/self-installer/master/install.js | node
|
25
|
+
```
|
26
|
+
|
27
|
+
After installing `pnpm`, simply add `webpacker-pnpm` to your app's `Gemfile`. There is no need to worry about your official Webpacker gem version, as this gem should be version-agnostic.
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem "webpacker-pnpm"
|
31
|
+
```
|
32
|
+
|
33
|
+
## License
|
34
|
+
|
35
|
+
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit <http://creativecommons.org/licenses/by-nc-sa/4.0/> or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "webpacker/pnpm"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
4
|
+
|
5
|
+
gemspec path: "../"
|
6
|
+
|
7
|
+
gem "rails", github: "rails/rails"
|
8
|
+
gem "arel", github: "rails/arel"
|
9
|
+
gem "rake", ">= 11.1"
|
10
|
+
gem "rack-proxy", require: false
|
11
|
+
gem "minitest", "~> 5.0"
|
12
|
+
gem "byebug"
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
require "webpacker/runner"
|
5
|
+
require "webpacker/compiler"
|
6
|
+
|
7
|
+
module Webpacker
|
8
|
+
module PNPM
|
9
|
+
# remove Yarn's lockfile from and add pnpm's lockfile to the default list of
|
10
|
+
# watched paths
|
11
|
+
Webpacker::Compiler.class_eval do
|
12
|
+
def default_watched_paths
|
13
|
+
[
|
14
|
+
*config.resolved_paths_globbed,
|
15
|
+
config.source_path_globbed,
|
16
|
+
"pnpm-lock.yaml", "package.json",
|
17
|
+
"config/webpack/**/*"
|
18
|
+
].freeze
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# intercept command execution via Thor to replace yarn with pnpm. this exists in
|
23
|
+
# order to patch existing Webpacker installation templates that make direct
|
24
|
+
# calls to install Yarn dependencies. as a result, this isn't a robust patch
|
25
|
+
Rails::Generators::Actions.module_eval do
|
26
|
+
def run(command, config = {})
|
27
|
+
cmd = command.to_s
|
28
|
+
|
29
|
+
if cmd.include?("yarn")
|
30
|
+
cmd.gsub!("yarn", "pnpm")
|
31
|
+
cmd.gsub!("--dev", "--save-dev")
|
32
|
+
end
|
33
|
+
|
34
|
+
super(cmd, config)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# intercept generic task loading to clear and alias Yarn tasks
|
39
|
+
Rails::Engine.class_eval do
|
40
|
+
alias_method :unfiltered_tasks, :load_tasks
|
41
|
+
|
42
|
+
def load_tasks(_app = self)
|
43
|
+
unfiltered_tasks
|
44
|
+
# rather than clear the tasks, alias them to the new pnpm tasks so
|
45
|
+
# that any external code will still run
|
46
|
+
Rake::Task["webpacker:check_yarn"].clear.enhance(["webpacker:check_pnpm"])
|
47
|
+
Rake::Task["webpacker:yarn_install"].clear.enhance(["webpacker:pnpm_install"])
|
48
|
+
Rake::Task["webpacker:info"].clear.enhance(["webpacker:env"])
|
49
|
+
Rake::Task["yarn:install"].clear.enhance(["webpacker:pnpm_install"])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/railtie"
|
4
|
+
|
5
|
+
module Webpacker
|
6
|
+
module PNPM
|
7
|
+
class Railtie < Rails::Railtie
|
8
|
+
private
|
9
|
+
|
10
|
+
rake_tasks do
|
11
|
+
# load all the rake tasks within the `tasks` directory
|
12
|
+
Dir[File.join(File.dirname(__FILE__), "../tasks/**/*.rake")].each do |task|
|
13
|
+
load task
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# manually specify bin path to skip Yarn execution during Webpack runner
|
18
|
+
# initialization
|
19
|
+
config.before_configuration do
|
20
|
+
ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] ||= File.join(`pnpm root`.chomp, ".bin")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "semantic_range"
|
4
|
+
namespace :webpacker do
|
5
|
+
desc "Verifies if pnpm is installed"
|
6
|
+
task check_pnpm: [:environment] do
|
7
|
+
begin
|
8
|
+
$stdout.puts "Verifying pnpm version..."
|
9
|
+
|
10
|
+
pnpm_version = `pnpm --version`.chomp
|
11
|
+
raise Errno::ENOENT if pnpm_version.blank?
|
12
|
+
|
13
|
+
pnpm_range = ">=3.0.0"
|
14
|
+
is_unsupported = SemanticRange.satisfies?(pnpm_version, pnpm_range) rescue false
|
15
|
+
|
16
|
+
unless is_unsupported
|
17
|
+
warn "Webpacker requires pnpm \"#{pnpm_range}\" and you are using #{pnpm_version}. Please upgrade pnpm https://pnpm.js.org/en/installation/"
|
18
|
+
warn "Exiting!"
|
19
|
+
exit!
|
20
|
+
end
|
21
|
+
rescue Errno::ENOENT
|
22
|
+
warn "pnpm is not installed. Please download and install pnpm from https://pnpm.js.org/en/installation/"
|
23
|
+
warn "Exiting!"
|
24
|
+
exit!
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "webpacker/version"
|
4
|
+
|
5
|
+
namespace :webpacker do
|
6
|
+
desc "Provide information on Webpacker's environment"
|
7
|
+
task env: [:environment] do
|
8
|
+
$stdout.puts "Ruby: #{`ruby --version`}"
|
9
|
+
$stdout.puts "Rails: #{Rails.version}"
|
10
|
+
$stdout.puts "Webpacker: #{Webpacker::VERSION}"
|
11
|
+
$stdout.puts "Node: #{`node --version`}"
|
12
|
+
$stdout.puts "pnpm: #{`pnpm --version`}"
|
13
|
+
|
14
|
+
$stdout.puts "\n"
|
15
|
+
$stdout.puts "@rails/webpacker: \n#{`npm list @rails/webpacker version`}"
|
16
|
+
|
17
|
+
$stdout.puts "Is bin/webpack present?: #{File.exist? 'bin/webpack'}"
|
18
|
+
$stdout.puts "Is bin/webpack-dev-server present?: #{File.exist? 'bin/webpack-dev-server'}"
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :webpacker do
|
4
|
+
desc "Support for older Rails versions. Install all JavaScript dependencies as specified via pnpm"
|
5
|
+
task pnpm_install: [:environment] do
|
6
|
+
valid_node_envs = %w[test development production]
|
7
|
+
|
8
|
+
node_env = ENV.fetch("NODE_ENV") do
|
9
|
+
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
10
|
+
end
|
11
|
+
|
12
|
+
system({ "NODE_ENV" => node_env }, "pnpm i --frozen-lockfile")
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
module Webpacker
|
6
|
+
module PNPM
|
7
|
+
class RakeTasksTest < Test
|
8
|
+
def test_rake_tasks
|
9
|
+
output = chdir_concurrent(test_path, "bundle exec rake --tasks")
|
10
|
+
assert_includes output, "webpacker"
|
11
|
+
assert_includes output, "webpacker:binstubs"
|
12
|
+
assert_includes output, "webpacker:check_binstubs"
|
13
|
+
assert_includes output, "webpacker:check_node"
|
14
|
+
assert_includes output, "webpacker:check_pnpm"
|
15
|
+
assert_includes output, "webpacker:clean"
|
16
|
+
assert_includes output, "webpacker:clobber"
|
17
|
+
assert_includes output, "webpacker:compile"
|
18
|
+
assert_includes output, "webpacker:env"
|
19
|
+
assert_includes output, "webpacker:install"
|
20
|
+
assert_includes output, "webpacker:install:angular"
|
21
|
+
assert_includes output, "webpacker:install:coffee"
|
22
|
+
assert_includes output, "webpacker:install:elm"
|
23
|
+
assert_includes output, "webpacker:install:erb"
|
24
|
+
assert_includes output, "webpacker:install:react"
|
25
|
+
assert_includes output, "webpacker:install:svelte"
|
26
|
+
assert_includes output, "webpacker:install:stimulus"
|
27
|
+
assert_includes output, "webpacker:install:typescript"
|
28
|
+
assert_includes output, "webpacker:install:vue"
|
29
|
+
assert_includes output, "webpacker:pnpm_install"
|
30
|
+
assert_includes output, "webpacker:verify_install"
|
31
|
+
|
32
|
+
assert_not_includes output, "webpacker:check_yarn"
|
33
|
+
assert_not_includes output, "webpacker:yarn_install"
|
34
|
+
assert_not_includes output, "yarn:install"
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_check_pnpm_version
|
38
|
+
output = chdir_concurrent(test_path, "rake webpacker:check_pnpm 2>&1")
|
39
|
+
assert_not_includes output, "pnpm is not installed"
|
40
|
+
assert_not_includes output, "Webpacker requires pnpm"
|
41
|
+
|
42
|
+
assert_includes output, "Verifying pnpm version..."
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_override_check_yarn_version
|
46
|
+
output = chdir_concurrent(test_path, "rake webpacker:check_yarn 2>&1")
|
47
|
+
assert_not_includes output, "pnpm is not installed"
|
48
|
+
assert_not_includes output, "Webpacker requires pnpm"
|
49
|
+
|
50
|
+
assert_includes output, "Verifying pnpm version..."
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_pnpm_install_in_production_env
|
54
|
+
cmd = "bundle exec rake webpacker:pnpm_install"
|
55
|
+
|
56
|
+
chdir_concurrent(test_path, cmd, { NODE_ENV: :production }, { isolated: true }) do |_, temp|
|
57
|
+
assert_not_includes installed_node_modules(temp), "right-pad", "Expected only production dependencies to be installed"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_pnpm_install_in_test_env
|
62
|
+
assert_includes test_app_dev_dependencies, "right-pad"
|
63
|
+
|
64
|
+
cmd = "bundle exec rake webpacker:pnpm_install"
|
65
|
+
|
66
|
+
chdir_concurrent(test_path, cmd, { NODE_ENV: :test }, { isolated: true }) do |_, temp|
|
67
|
+
assert_includes installed_node_modules(temp), "right-pad", "Expected dev dependencies to be installed"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_yarn_install_alias_in_production_env
|
72
|
+
cmd = "bundle exec rake webpacker:yarn_install"
|
73
|
+
|
74
|
+
chdir_concurrent(test_path, cmd, { NODE_ENV: :production }, { isolated: true }) do |_, temp|
|
75
|
+
assert_not_includes installed_node_modules(temp), "right-pad", "Expected only production dependencies to be installed"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_yarn_install_alias_in_test_env
|
80
|
+
assert_includes test_app_dev_dependencies, "right-pad"
|
81
|
+
|
82
|
+
cmd = "bundle exec rake webpacker:yarn_install"
|
83
|
+
|
84
|
+
chdir_concurrent(test_path, cmd, { NODE_ENV: :test }, { isolated: true }) do |_, temp|
|
85
|
+
assert_includes installed_node_modules(temp), "right-pad", "Expected dev dependencies to be installed"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
def test_path
|
92
|
+
File.expand_path("test_app", __dir__)
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_app_dev_dependencies
|
96
|
+
package_json = File.expand_path("package.json", test_path)
|
97
|
+
JSON.parse(File.read(package_json))["devDependencies"]
|
98
|
+
end
|
99
|
+
|
100
|
+
def installed_node_modules(dir)
|
101
|
+
node_modules_path = File.expand_path("node_modules", dir)
|
102
|
+
Dir.entries(node_modules_path)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,10 @@
|
|
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!')
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby.exe
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "fileutils"
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
FileUtils.chdir APP_ROOT do
|
14
|
+
# This script is a way to setup or update your development environment automatically.
|
15
|
+
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
16
|
+
# Add necessary setup steps to this file.
|
17
|
+
|
18
|
+
puts "== Installing dependencies =="
|
19
|
+
system! "gem install bundler --conservative"
|
20
|
+
system("bundle check") || system!("bundle install")
|
21
|
+
|
22
|
+
puts "\n== Removing old logs and tempfiles =="
|
23
|
+
system! "bin/rails log:clear tmp:clear"
|
24
|
+
|
25
|
+
puts "\n== Restarting application server =="
|
26
|
+
system! "bin/rails restart"
|
27
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
+
|
7
|
+
require "pathname"
|
8
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
9
|
+
|
10
|
+
require "bundler/setup"
|
11
|
+
|
12
|
+
require "webpacker"
|
13
|
+
require "webpacker/webpack_runner"
|
14
|
+
Webpacker::WebpackRunner.run(ARGV)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
+
|
7
|
+
require "pathname"
|
8
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
9
|
+
|
10
|
+
require "bundler/setup"
|
11
|
+
|
12
|
+
require "webpacker"
|
13
|
+
require "webpacker/dev_server_runner"
|
14
|
+
Webpacker::DevServerRunner.run(ARGV)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "action_controller/railtie"
|
4
|
+
require "action_view/railtie"
|
5
|
+
require "webpacker"
|
6
|
+
require "webpacker/pnpm"
|
7
|
+
|
8
|
+
module TestApp
|
9
|
+
class Application < ::Rails::Application
|
10
|
+
config.secret_key_base = "abcdef"
|
11
|
+
config.eager_load = true
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
+
|
3
|
+
default: &default
|
4
|
+
source_path: app/javascript
|
5
|
+
source_entry_path: packs
|
6
|
+
public_root_path: public
|
7
|
+
public_output_path: packs
|
8
|
+
cache_path: tmp/cache/webpacker
|
9
|
+
webpack_compile_output: false
|
10
|
+
|
11
|
+
# Additional paths webpack should lookup modules
|
12
|
+
# ['app/assets', 'engine/foo/app/assets']
|
13
|
+
resolved_paths: []
|
14
|
+
|
15
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
16
|
+
cache_manifest: false
|
17
|
+
|
18
|
+
# Extract and emit a css file
|
19
|
+
extract_css: false
|
20
|
+
|
21
|
+
static_assets_extensions:
|
22
|
+
- .jpg
|
23
|
+
- .jpeg
|
24
|
+
- .png
|
25
|
+
- .gif
|
26
|
+
- .tiff
|
27
|
+
- .ico
|
28
|
+
- .svg
|
29
|
+
|
30
|
+
extensions:
|
31
|
+
- .vue
|
32
|
+
- .mjs
|
33
|
+
- .js
|
34
|
+
- .sass
|
35
|
+
- .scss
|
36
|
+
- .css
|
37
|
+
- .module.sass
|
38
|
+
- .module.scss
|
39
|
+
- .module.css
|
40
|
+
- .png
|
41
|
+
- .svg
|
42
|
+
- .gif
|
43
|
+
- .jpeg
|
44
|
+
- .jpg
|
45
|
+
|
46
|
+
development:
|
47
|
+
<<: *default
|
48
|
+
compile: true
|
49
|
+
|
50
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
51
|
+
dev_server:
|
52
|
+
https: false
|
53
|
+
host: localhost
|
54
|
+
port: 3035
|
55
|
+
public: localhost:3035
|
56
|
+
hmr: false
|
57
|
+
# Inline should be set to true if using HMR
|
58
|
+
inline: true
|
59
|
+
overlay: true
|
60
|
+
disable_host_check: true
|
61
|
+
use_local_ip: false
|
62
|
+
pretty: false
|
63
|
+
|
64
|
+
test:
|
65
|
+
<<: *default
|
66
|
+
compile: true
|
67
|
+
|
68
|
+
# Compile test packs to a separate directory
|
69
|
+
public_output_path: packs-test
|
70
|
+
|
71
|
+
production:
|
72
|
+
<<: *default
|
73
|
+
|
74
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
75
|
+
compile: false
|
76
|
+
|
77
|
+
# Extract and emit a css file
|
78
|
+
extract_css: true
|
79
|
+
|
80
|
+
# Cache manifest.json for performance
|
81
|
+
cache_manifest: true
|
82
|
+
|
83
|
+
staging:
|
84
|
+
<<: *default
|
85
|
+
|
86
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
87
|
+
compile: false
|
88
|
+
|
89
|
+
# Extract and emit a css file
|
90
|
+
extract_css: true
|
91
|
+
|
92
|
+
# Cache manifest.json for performance
|
93
|
+
cache_manifest: true
|
94
|
+
|
95
|
+
# Compile staging packs to a separate directory
|
96
|
+
public_output_path: packs-staging
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
+
|
3
|
+
default: &default
|
4
|
+
public_root_path: ../public
|
5
|
+
|
6
|
+
development:
|
7
|
+
<<: *default
|
8
|
+
compile: true
|
9
|
+
|
10
|
+
test:
|
11
|
+
<<: *default
|
12
|
+
compile: true
|
13
|
+
public_output_path: packs-test
|
14
|
+
|
15
|
+
production:
|
16
|
+
<<: *default
|
17
|
+
compile: false
|
18
|
+
extract_css: true
|
19
|
+
cache_manifest: true
|
@@ -0,0 +1,20 @@
|
|
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
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"bootstrap.css": "/packs/bootstrap-c38deda30895059837cf.css",
|
3
|
+
"application.css": "/packs/application-dd6b1cd38bfa093df600.css",
|
4
|
+
"bootstrap.js": "/packs/bootstrap-300631c4f0e0f9c865bc.js",
|
5
|
+
"application.js": "/packs/application-k344a6d59eef8632c9d1.js",
|
6
|
+
"application.png": "/packs/application-k344a6d59eef8632c9d1.png",
|
7
|
+
"fonts/fa-regular-400.woff2": "/packs/fonts/fa-regular-400-944fb546bd7018b07190a32244f67dc9.woff2",
|
8
|
+
"media/images/image.jpg": "/packs/media/images/image-c38deda30895059837cf.jpg",
|
9
|
+
"media/images/nested/image.jpg": "/packs/media/images/nested/image-c38deda30895059837cf.jpg",
|
10
|
+
"media/images/mb-icon.png": "/packs/media/images/mb-icon-c38deda30895059837cf.png",
|
11
|
+
"media/images/nested/mb-icon.png": "/packs/media/images/nested/mb-icon-c38deda30895059837cf.png",
|
12
|
+
"entrypoints": {
|
13
|
+
"application": {
|
14
|
+
"js": [
|
15
|
+
"/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js",
|
16
|
+
"/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js",
|
17
|
+
"/packs/application-k344a6d59eef8632c9d1.js"
|
18
|
+
],
|
19
|
+
"css": [
|
20
|
+
"/packs/1-c20632e7baf2c81200d3.chunk.css",
|
21
|
+
"/packs/application-k344a6d59eef8632c9d1.chunk.css"
|
22
|
+
]
|
23
|
+
},
|
24
|
+
"hello_stimulus": {
|
25
|
+
"css": [
|
26
|
+
"/packs/1-c20632e7baf2c81200d3.chunk.css",
|
27
|
+
"/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
require "rails/test_help"
|
5
|
+
require "etc"
|
6
|
+
require "fileutils"
|
7
|
+
require "open3"
|
8
|
+
|
9
|
+
require_relative "test_app/config/environment"
|
10
|
+
|
11
|
+
Rails.env = "production"
|
12
|
+
Webpacker.instance = ::Webpacker::Instance.new
|
13
|
+
|
14
|
+
module Webpacker
|
15
|
+
module PNPM
|
16
|
+
class Test < ActiveSupport::TestCase
|
17
|
+
# force test parallelization - this is not about test speed, it is about
|
18
|
+
# maximizing the likelihood of having tests fail by providing isolated
|
19
|
+
# execution threads. manually specify the number of workers, as by default
|
20
|
+
# Rails uses the number of physical, not logical, cores. Additionally,
|
21
|
+
# spawn threads rather than fork processes as Rails' DRb implementation
|
22
|
+
# only supports UNIX systems
|
23
|
+
Minitest.parallel_executor = Minitest::Parallel::Executor.new(Etc.nprocessors)
|
24
|
+
parallelize_me!
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
# concurrent scoped chdir calls are not supported, as they can cause
|
29
|
+
# unforeseen and unpredictable bugs. instead, allow copying the desired
|
30
|
+
# directory to a temp directory before performing possible filesystem
|
31
|
+
# manipulations. opts are passed through to Open3::capture2e
|
32
|
+
def chdir_concurrent(dir, cmd, env = {}, opts = {})
|
33
|
+
# Process::spawn requires an env hash of strings
|
34
|
+
env.stringify_keys!
|
35
|
+
env.transform_values!(&:to_s)
|
36
|
+
|
37
|
+
env = ENV.to_h.merge(env)
|
38
|
+
isolated = opts.delete(:isolated)
|
39
|
+
output = nil
|
40
|
+
|
41
|
+
begin
|
42
|
+
# if we're want an isolated environment, copy the directory contents to
|
43
|
+
# a new temporary directory and change the working directory to it
|
44
|
+
if isolated
|
45
|
+
files = Dir[File.join(dir, "*")].reject do |f|
|
46
|
+
f.include?("node_modules")
|
47
|
+
end
|
48
|
+
|
49
|
+
dir = Dir.mktmpdir
|
50
|
+
FileUtils.cp_r(files, dir)
|
51
|
+
end
|
52
|
+
|
53
|
+
output, = Open3.capture2e(env, "cd #{dir} && #{cmd}", opts)
|
54
|
+
yield(output, dir) if block_given?
|
55
|
+
ensure
|
56
|
+
# make sure we remove the generated temp directory
|
57
|
+
FileUtils.remove_entry_secure(dir) if isolated
|
58
|
+
end
|
59
|
+
|
60
|
+
output
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "webpacker/pnpm/version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "webpacker-pnpm"
|
9
|
+
spec.version = Webpacker::PNPM::VERSION
|
10
|
+
spec.authors = ["Elias Gabriel"]
|
11
|
+
spec.email = ["me@eliasfgabriel.com"]
|
12
|
+
spec.summary = "Replaces Webpacker's Yarn environment with pnpm"
|
13
|
+
spec.homepage = "https://github.com/thearchitector/webpacker-pnpm"
|
14
|
+
spec.license = "CC-BY-NC-SA-4.0"
|
15
|
+
|
16
|
+
spec.metadata = {
|
17
|
+
"homepage_uri" => spec.homepage,
|
18
|
+
"source_code_uri" => "https://github.com/thearchitector/webpacker-pnpm/tree/v#{Webpacker::PNPM::VERSION}",
|
19
|
+
"changelog_uri" => "https://github.com/thearchitector/webpacker-pnpm/blob/v#{Webpacker::PNPM::VERSION}/CHANGELOG.md"
|
20
|
+
}
|
21
|
+
|
22
|
+
spec.required_ruby_version = ">= 2.4.0"
|
23
|
+
|
24
|
+
spec.add_dependency "activesupport", ">= 5.2"
|
25
|
+
spec.add_dependency "rack-proxy", ">= 0.6.1"
|
26
|
+
spec.add_dependency "railties", ">= 5.2"
|
27
|
+
spec.add_dependency "semantic_range", ">= 2.3.0"
|
28
|
+
spec.add_dependency "webpacker", "~> 5.x"
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
31
|
+
spec.add_development_dependency "rubocop"
|
32
|
+
spec.add_development_dependency "rubocop-rails"
|
33
|
+
|
34
|
+
spec.files = `git ls-files`.split("\n")
|
35
|
+
spec.test_files = `git ls-files -- test/*`.split("\n")
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,226 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webpacker-pnpm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Elias Gabriel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack-proxy
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: railties
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: semantic_range
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.3.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.3.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webpacker
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 5.x
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 5.x
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- me@eliasfgabriel.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitattributes"
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rubocop.yml"
|
135
|
+
- ".travis.yml"
|
136
|
+
- CHANGELOG.md
|
137
|
+
- Gemfile
|
138
|
+
- README.md
|
139
|
+
- Rakefile
|
140
|
+
- bin/console
|
141
|
+
- bin/setup
|
142
|
+
- gemfiles/Gemfile-rails-edge
|
143
|
+
- gemfiles/Gemfile-rails.5.2.x
|
144
|
+
- gemfiles/Gemfile-rails.6.0.x
|
145
|
+
- lib/webpacker/pnpm.rb
|
146
|
+
- lib/webpacker/pnpm/patches.rb
|
147
|
+
- lib/webpacker/pnpm/railtie.rb
|
148
|
+
- lib/webpacker/pnpm/version.rb
|
149
|
+
- lib/webpacker/tasks/check_pnpm.rake
|
150
|
+
- lib/webpacker/tasks/env.rake
|
151
|
+
- lib/webpacker/tasks/pnpm_install.rake
|
152
|
+
- test/rake_tasks_test.rb
|
153
|
+
- test/test_app/.gitignore
|
154
|
+
- test/test_app/Rakefile
|
155
|
+
- test/test_app/app/javascript/packs/application.js
|
156
|
+
- test/test_app/app/javascript/packs/multi_entry.css
|
157
|
+
- test/test_app/app/javascript/packs/multi_entry.js
|
158
|
+
- test/test_app/bin/rails
|
159
|
+
- test/test_app/bin/rake
|
160
|
+
- test/test_app/bin/setup
|
161
|
+
- test/test_app/bin/webpack
|
162
|
+
- test/test_app/bin/webpack-dev-server
|
163
|
+
- test/test_app/config.ru
|
164
|
+
- test/test_app/config/application.rb
|
165
|
+
- test/test_app/config/boot.rb
|
166
|
+
- test/test_app/config/environment.rb
|
167
|
+
- test/test_app/config/webpack/development.js
|
168
|
+
- test/test_app/config/webpack/environment.js
|
169
|
+
- test/test_app/config/webpacker.yml
|
170
|
+
- test/test_app/config/webpacker_public_root.yml
|
171
|
+
- test/test_app/package.json
|
172
|
+
- test/test_app/pnpm-lock.yaml
|
173
|
+
- test/test_app/public/packs/manifest.json
|
174
|
+
- test/test_helper.rb
|
175
|
+
- webpacker-pnpm.gemspec
|
176
|
+
homepage: https://github.com/thearchitector/webpacker-pnpm
|
177
|
+
licenses:
|
178
|
+
- CC-BY-NC-SA-4.0
|
179
|
+
metadata:
|
180
|
+
homepage_uri: https://github.com/thearchitector/webpacker-pnpm
|
181
|
+
source_code_uri: https://github.com/thearchitector/webpacker-pnpm/tree/v1.2.0
|
182
|
+
changelog_uri: https://github.com/thearchitector/webpacker-pnpm/blob/v1.2.0/CHANGELOG.md
|
183
|
+
post_install_message:
|
184
|
+
rdoc_options: []
|
185
|
+
require_paths:
|
186
|
+
- lib
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: 2.4.0
|
192
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
requirements: []
|
198
|
+
rubyforge_project:
|
199
|
+
rubygems_version: 2.7.6.2
|
200
|
+
signing_key:
|
201
|
+
specification_version: 4
|
202
|
+
summary: Replaces Webpacker's Yarn environment with pnpm
|
203
|
+
test_files:
|
204
|
+
- test/rake_tasks_test.rb
|
205
|
+
- test/test_app/.gitignore
|
206
|
+
- test/test_app/Rakefile
|
207
|
+
- test/test_app/app/javascript/packs/application.js
|
208
|
+
- test/test_app/app/javascript/packs/multi_entry.css
|
209
|
+
- test/test_app/app/javascript/packs/multi_entry.js
|
210
|
+
- test/test_app/bin/rails
|
211
|
+
- test/test_app/bin/rake
|
212
|
+
- test/test_app/bin/setup
|
213
|
+
- test/test_app/bin/webpack
|
214
|
+
- test/test_app/bin/webpack-dev-server
|
215
|
+
- test/test_app/config.ru
|
216
|
+
- test/test_app/config/application.rb
|
217
|
+
- test/test_app/config/boot.rb
|
218
|
+
- test/test_app/config/environment.rb
|
219
|
+
- test/test_app/config/webpack/development.js
|
220
|
+
- test/test_app/config/webpack/environment.js
|
221
|
+
- test/test_app/config/webpacker.yml
|
222
|
+
- test/test_app/config/webpacker_public_root.yml
|
223
|
+
- test/test_app/package.json
|
224
|
+
- test/test_app/pnpm-lock.yaml
|
225
|
+
- test/test_app/public/packs/manifest.json
|
226
|
+
- test/test_helper.rb
|