webpacker-pnpm 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +0 -0
  3. data/.github/FUNDING.yml +3 -0
  4. data/.github/workflows/ci.yaml +50 -0
  5. data/.gitignore +5 -2
  6. data/.rubocop.yml +24 -91
  7. data/CHANGELOG.md +69 -45
  8. data/Gemfile +8 -17
  9. data/LICENSE +29 -0
  10. data/README.md +33 -35
  11. data/Rakefile +11 -11
  12. data/bin/console +15 -15
  13. data/bin/setup +8 -8
  14. data/gemfiles/Gemfile-rails.5.2.x +0 -0
  15. data/gemfiles/Gemfile-rails.6.0.x +0 -0
  16. data/lib/webpacker/pnpm/patches.rb +61 -53
  17. data/lib/webpacker/pnpm/railtie.rb +33 -24
  18. data/lib/webpacker/pnpm/version.rb +9 -7
  19. data/lib/webpacker/pnpm.rb +5 -5
  20. data/lib/webpacker/tasks/check_pnpm.rake +42 -27
  21. data/lib/webpacker/tasks/env.rake +22 -20
  22. data/lib/webpacker/tasks/pnpm_install.rake +14 -14
  23. data/test/rake_tasks_test.rb +97 -106
  24. data/test/test_app/.gitignore +6 -6
  25. data/test/test_app/Rakefile +5 -5
  26. data/test/test_app/app/javascript/packs/application.js +10 -10
  27. data/test/test_app/app/javascript/packs/multi_entry.css +3 -3
  28. data/test/test_app/app/javascript/packs/multi_entry.js +4 -4
  29. data/test/test_app/bin/rails +4 -6
  30. data/test/test_app/bin/rake +4 -6
  31. data/test/test_app/bin/setup +25 -27
  32. data/test/test_app/bin/webpack +15 -14
  33. data/test/test_app/bin/webpack-dev-server +15 -14
  34. data/test/test_app/config/application.rb +13 -13
  35. data/test/test_app/config/boot.rb +5 -0
  36. data/test/test_app/config/environment.rb +6 -6
  37. data/test/test_app/config/webpack/development.js +0 -0
  38. data/test/test_app/config/webpack/environment.js +0 -0
  39. data/test/test_app/config/webpacker.yml +0 -0
  40. data/test/test_app/config/webpacker_public_root.yml +19 -19
  41. data/test/test_app/config.ru +7 -7
  42. data/test/test_app/package.json +0 -0
  43. data/test/test_app/pnpm-lock.yaml +0 -0
  44. data/test/test_app/public/packs/manifest.json +31 -31
  45. data/test/test_helper.rb +61 -64
  46. data/webpacker-pnpm.gemspec +44 -36
  47. metadata +72 -42
  48. data/.travis.yml +0 -45
  49. data/gemfiles/Gemfile-rails-edge +0 -12
@@ -1,24 +1,33 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/railtie"
4
+
5
+ module Webpacker
6
+ module PNPM
7
+ class Railtie < Rails::Railtie
8
+ rake_tasks do
9
+ # load all the rake tasks within the `tasks` directory
10
+ Dir[File.join(File.dirname(__FILE__), "../tasks/**/*.rake")].each do |task|
11
+ load task
12
+ end
13
+ end
14
+
15
+ # manually specify node_modules bin path to skip Yarn execution during
16
+ # Webpack runner initialization
17
+ config.before_configuration do
18
+ begin
19
+ ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] ||= File.join(`pnpm root`.chomp, ".bin")
20
+ rescue Errno::ENOENT
21
+ # use abort instead of Rails' logger because it doesn't show up when
22
+ # run within Rake tasks
23
+ abort(
24
+ <<~HEREDOC.squish
25
+ \e[31m[FATAL] pnpm is not installed or not present in $PATH.
26
+ Install pnpm and try again.\e[0m
27
+ HEREDOC
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,7 +1,9 @@
1
- # frozen_string_literal: true
2
-
3
- module Webpacker
4
- module PNPM
5
- VERSION = "1.2.0"
6
- end
7
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Webpacker
4
+ module PNPM
5
+ VERSION = "1.2.2"
6
+
7
+ public_constant :VERSION
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "pnpm/version"
4
- require_relative "pnpm/railtie"
5
- require_relative "pnpm/patches"
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "pnpm/version"
4
+ require_relative "pnpm/railtie"
5
+ require_relative "pnpm/patches"
@@ -1,27 +1,42 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ require "semantic_range"
4
+
5
+ namespace :webpacker do
6
+ desc "Verifies if pnpm is installed"
7
+ task check_pnpm: [:environment] do
8
+ begin
9
+ $stdout.puts "Verifying pnpm version..."
10
+
11
+ pnpm_version = `pnpm --version`.chomp
12
+ raise Errno::ENOENT if pnpm_version.blank?
13
+
14
+ begin
15
+ pnpm_range = ">= 3.0.0"
16
+ is_unsupported = SemanticRange.satisfies?(pnpm_version, pnpm_range)
17
+ rescue StandardError
18
+ is_unsupported = false
19
+ end
20
+
21
+ unless is_unsupported
22
+ warn(
23
+ <<~HEREDOC.squish
24
+ Webpacker requires pnpm \"#{pnpm_range}\" and you are using #{pnpm_version}.
25
+ Please upgrade pnpm https://pnpm.js.org/en/installation/.
26
+ HEREDOC
27
+ )
28
+ warn("Exiting!")
29
+ exit!
30
+ end
31
+ rescue Errno::ENOENT
32
+ warn(
33
+ <<~HEREDOC.squish
34
+ pnpm is not installed. Please download and install pnpm from
35
+ https://pnpm.js.org/en/installation/.
36
+ HEREDOC
37
+ )
38
+ warn("Exiting!")
39
+ exit!
40
+ end
41
+ end
42
+ end
@@ -1,20 +1,22 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ require "webpacker/version"
4
+
5
+ namespace :webpacker do
6
+ desc "Provide information on Webpacker's current 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 <<~HEREDOC.squish
19
+ Is bin/webpack-dev-server present?: #{File.exist?("bin/webpack-dev-server")}
20
+ HEREDOC
21
+ end
22
+ end
@@ -1,14 +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
1
+ # frozen_string_literal: true
2
+
3
+ namespace :webpacker do
4
+ desc "Install all JavaScript dependencies as specified via pnpm."
5
+ task pnpm_install: [:environment] do
6
+ valid_node_envs = ["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 --shamefully-hoist")
13
+ end
14
+ end
@@ -1,106 +1,97 @@
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
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:check_pnpm")
11
+ assert_includes(output, "webpacker:pnpm_install")
12
+ assert_includes(output, "webpacker:env")
13
+
14
+ assert_not_includes(output, "webpacker:check_yarn")
15
+ assert_not_includes(output, "webpacker:yarn_install")
16
+ assert_not_includes(output, "yarn:install")
17
+ assert_not_includes(output, "webpacker:info")
18
+ end
19
+
20
+ def test_check_pnpm_version
21
+ output = chdir_concurrent(test_path, "rake webpacker:check_pnpm")
22
+ assert_not_includes(output, "pnpm is not installed")
23
+ assert_not_includes(output, "Webpacker requires pnpm")
24
+
25
+ assert_includes(output, "Verifying pnpm version...")
26
+ end
27
+
28
+ def test_override_check_yarn_version
29
+ output = chdir_concurrent(test_path, "rake webpacker:check_yarn")
30
+ assert_not_includes(output, "pnpm is not installed")
31
+ assert_not_includes(output, "Webpacker requires pnpm")
32
+
33
+ assert_includes(output, "Verifying pnpm version...")
34
+ end
35
+
36
+ def test_pnpm_install_in_production_env
37
+ cmd = "bundle exec rake webpacker:pnpm_install"
38
+ chdir_concurrent(test_path, cmd, { "NODE_ENV": "production" },
39
+ { isolated: true }) do |temp|
40
+ assert_not_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
41
+ Expected only production dependencies to be installed
42
+ HEREDOC
43
+ end
44
+ end
45
+
46
+ def test_pnpm_install_in_test_env
47
+ assert_includes(test_app_dev_dependencies, "right-pad")
48
+
49
+ cmd = "bundle exec rake webpacker:pnpm_install"
50
+ chdir_concurrent(test_path, cmd, { "NODE_ENV": "test" },
51
+ { isolated: true }) do |temp|
52
+ assert_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
53
+ Expected dev dependencies to be installed
54
+ HEREDOC
55
+ end
56
+ end
57
+
58
+ def test_yarn_install_alias_in_production_env
59
+ cmd = "bundle exec rake webpacker:yarn_install"
60
+ chdir_concurrent(test_path, cmd, { "NODE_ENV": "production" },
61
+ { isolated: true }) do |temp|
62
+ assert_not_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
63
+ Expected only production dependencies to be installed
64
+ HEREDOC
65
+ end
66
+ end
67
+
68
+ def test_yarn_install_alias_in_test_env
69
+ assert_includes(test_app_dev_dependencies, "right-pad")
70
+
71
+ cmd = "bundle exec rake webpacker:yarn_install"
72
+ chdir_concurrent(test_path, cmd, { "NODE_ENV": "test" },
73
+ { isolated: true }) do |temp|
74
+ assert_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
75
+ Expected dev dependencies to be installed
76
+ HEREDOC
77
+ end
78
+ end
79
+
80
+ private
81
+
82
+ def test_path
83
+ File.expand_path("test_app", __dir__)
84
+ end
85
+
86
+ def test_app_dev_dependencies
87
+ package_json = File.expand_path("package.json", test_path)
88
+ JSON.parse(File.read(package_json))["devDependencies"]
89
+ end
90
+
91
+ def installed_node_modules(dir)
92
+ node_modules_path = File.expand_path("node_modules", dir)
93
+ Dir.entries(node_modules_path)
94
+ end
95
+ end
96
+ end
97
+ end
@@ -1,7 +1,7 @@
1
- /.bundle/
2
- /coverage/
3
- /doc/
4
- /pkg/
5
- /spec/reports/
6
- /tmp/
1
+ /.bundle/
2
+ /coverage/
3
+ /doc/
4
+ /pkg/
5
+ /spec/reports/
6
+ /tmp/
7
7
  /node_modules
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "config/application"
4
-
5
- Rails.application.load_tasks
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "config/application"
4
+
5
+ Rails.application.load_tasks
@@ -1,10 +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!')
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,4 +1,4 @@
1
- /*
2
- * Dummy file #1 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
3
- * This file must be named the same
1
+ /*
2
+ * Dummy file #1 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
3
+ * This file must be named the same
4
4
  */
@@ -1,4 +1,4 @@
1
- /*
2
- * Dummy file #2 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
3
- * This file must be named the same
4
- */
1
+ /*
2
+ * Dummy file #2 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
3
+ * This file must be named the same
4
+ */
@@ -1,6 +1,4 @@
1
- #!/usr/bin/env ruby.exe
2
- # frozen_string_literal: true
3
-
4
- APP_PATH = File.expand_path("../config/application", __dir__)
5
- require_relative "../config/boot"
6
- require "rails/commands"
1
+ #!/usr/bin/env ruby.exe
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -1,6 +1,4 @@
1
- #!/usr/bin/env ruby.exe
2
- # frozen_string_literal: true
3
-
4
- require_relative "../config/boot"
5
- require "rake"
6
- Rake.application.run
1
+ #!/usr/bin/env ruby.exe
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -1,27 +1,25 @@
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
1
+ #!/usr/bin/env ruby.exe
2
+ require 'fileutils'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path('..', __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to setup or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ puts "\n== Removing old logs and tempfiles =="
21
+ system! 'bin/rails log:clear tmp:clear'
22
+
23
+ puts "\n== Restarting application server =="
24
+ system! 'bin/rails restart'
25
+ end
@@ -1,14 +1,15 @@
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)
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",
9
+ Pathname.new(__FILE__).realpath)
10
+
11
+ require "bundler/setup"
12
+
13
+ require "webpacker"
14
+ require "webpacker/webpack_runner"
15
+ Webpacker::WebpackRunner.run(ARGV)
@@ -1,14 +1,15 @@
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)
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",
9
+ Pathname.new(__FILE__).realpath)
10
+
11
+ require "bundler/setup"
12
+
13
+ require "webpacker"
14
+ require "webpacker/dev_server_runner"
15
+ Webpacker::DevServerRunner.run(ARGV)