diff --git a/CHANGELOG.md b/CHANGELOG.md index c840c742..581d061d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ Changes since the last non-beta release. - Remove `yarn_install` rake task, and stop installing js packages automatically as part of `assets:precompile` [PR 412](https://github.com/shakacode/shakapacker/pull/412) by [G-Rath](https://github.com/g-rath). +- Remove `check_yarn` rake task [PR 443](https://github.com/shakacode/shakapacker/pull/443) by [G-Rath](https://github.com/g-rath). + - Remove `https` option for `webpack-dev-server` [PR 414](https://github.com/shakacode/shakapacker/pull/414) by [G-Rath](https://github.com/g-rath). - Remove `verify_file_existance` method [PR 446](https://github.com/shakacode/shakapacker/pull/446) by [G-Rath](https://github.com/g-rath). diff --git a/lib/tasks/shakapacker/check_yarn.rake b/lib/tasks/shakapacker/check_yarn.rake deleted file mode 100644 index 3b9ea98e..00000000 --- a/lib/tasks/shakapacker/check_yarn.rake +++ /dev/null @@ -1,34 +0,0 @@ -namespace :shakapacker do - desc "Verifies if Yarn is installed" - task :check_yarn do - require "semantic_range" - - begin - which_command = Gem.win_platform? ? "where" : "which" - raise Errno::ENOENT if `#{which_command} yarn`.strip.empty? - - yarn_version = `yarn --version`.strip - raise Errno::ENOENT if yarn_version.blank? - - pkg_path = Pathname.new("#{__dir__}/../../../package.json").realpath - yarn_range = JSON.parse(pkg_path.read)["engines"]["yarn"] - is_valid = SemanticRange.satisfies?(yarn_version, yarn_range) rescue false - is_unsupported = SemanticRange.satisfies?(yarn_version, ">=4.0.0") rescue false - - unless is_valid - $stderr.puts "Shakapacker requires Yarn \"#{yarn_range}\" and you are using #{yarn_version}" - if is_unsupported - $stderr.puts "This version of Shakapacker does not support Yarn #{yarn_version}. Please downgrade to a supported version of Yarn https://yarnpkg.com/lang/en/docs/install/" - else - $stderr.puts "Please upgrade Yarn https://yarnpkg.com/lang/en/docs/install/" - end - $stderr.puts "Exiting!" - exit! - end - rescue Errno::ENOENT - $stderr.puts "Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/" - $stderr.puts "Exiting!" - exit! - end - end -end