homebrew-core/Formula/pnpm.rb

38 lines
1.5 KiB
Ruby

class Pnpm < Formula
require "language/node"
desc "📦🚀 Fast, disk space efficient package manager"
homepage "https://pnpm.io/"
url "https://registry.npmjs.org/pnpm/-/pnpm-6.31.0.tgz"
sha256 "8572a190629ca810bcd80aa8c401e1c67d39db6e8d08e6b1b092ab5f45a023e4"
license "MIT"
livecheck do
url "https://registry.npmjs.org/pnpm/latest"
regex(/["']version["']:\s*?["']([^"']+)["']/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "d6d57efe102e48acc2e331ef40ccde87b16b2561181199d91cf03963f75d0d21"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d6d57efe102e48acc2e331ef40ccde87b16b2561181199d91cf03963f75d0d21"
sha256 cellar: :any_skip_relocation, monterey: "12420d1cb801b0eaf17add4096196f9f3db86c425597f9f13e3c391a7328ded5"
sha256 cellar: :any_skip_relocation, big_sur: "b6f6dbc38d2aca2c9fdf64e15aef12906d43a8614358635eba0f1bf30242654d"
sha256 cellar: :any_skip_relocation, catalina: "b6f6dbc38d2aca2c9fdf64e15aef12906d43a8614358635eba0f1bf30242654d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "d6d57efe102e48acc2e331ef40ccde87b16b2561181199d91cf03963f75d0d21"
end
depends_on "node"
conflicts_with "corepack", because: "both installs `pnpm` and `pnpx` binaries"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
system "#{bin}/pnpm", "init", "-y"
assert_predicate testpath/"package.json", :exist?, "package.json must exist"
end
end