babel 7.4.5

Closes #40144.

Signed-off-by: Chongyu Zhu <i@lembacon.com>

Co-authored-by: Christian Moritz <chrmoritz@gmail.com>
This commit is contained in:
Rui Chen 2019-05-21 14:38:15 -04:00 committed by Chongyu Zhu
parent 76ddfccb16
commit 07b29d552a
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

View file

@ -4,8 +4,8 @@ require "json"
class Babel < Formula
desc "Compiler for writing next generation JavaScript"
homepage "https://babeljs.io/"
url "https://registry.npmjs.org/@babel/cli/-/cli-7.4.4.tgz"
sha256 "aa6b4c8d5564e44f68e0ac1198e8a13ae641fcd9af3119e38538e34a691f1dbb"
url "https://registry.npmjs.org/@babel/core/-/core-7.4.5.tgz"
sha256 "23950a9e697f5efee8dae8e6d7855f0dd22885c40a5243df1c0fd5b0b522f0e6"
bottle do
sha256 "700aa5420c7d1b736a331ce97bd97b96b3c4966e486cf14a75d07a2526b9cfd9" => :mojave
@ -15,17 +15,18 @@ class Babel < Formula
depends_on "node"
resource "babel-core" do
url "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz"
sha256 "e6fb0fdbf80d37114f28c2bb8903b2d14e5d7c88ea19ba23e38a3d55e2dd13ee"
resource "babel-cli" do
url "https://registry.npmjs.org/@babel/cli/-/cli-7.4.4.tgz"
sha256 "aa6b4c8d5564e44f68e0ac1198e8a13ae641fcd9af3119e38538e34a691f1dbb"
end
def install
(buildpath/"node_modules/@babel/core").install resource("babel-core")
(buildpath/"node_modules/@babel/core").install Dir["*"]
buildpath.install resource("babel-cli")
# declare babel-core as a bundledDependency of babel-cli
pkg_json = JSON.parse(IO.read("package.json"))
pkg_json["dependencies"]["@babel/core"] = resource("babel-core").version
pkg_json["dependencies"]["@babel/core"] = version
pkg_json["bundledDependencies"] = ["@babel/core"]
IO.write("package.json", JSON.pretty_generate(pkg_json))
@ -40,9 +41,5 @@ class Babel < Formula
system bin/"babel", "script.js", "--out-file", "script-compiled.js"
assert_predicate testpath/"script-compiled.js", :exist?, "script-compiled.js was not generated"
# Uncomment this for the next release,
# see https://github.com/Homebrew/homebrew-core/pull/35304#issuecomment-449335627.
# assert_equal version, resource("babel-core").version
end
end