diff --git a/CODEOWNERS b/CODEOWNERS index e4e3c0f..a077ff0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -11,6 +11,7 @@ Formula/aittributor.rb @alecthomas Formula/anchors.rb @loganj Formula/francis.rb @tcmulcahy +Formula/ghost.rb @chailandau @nahiyankhan Formula/lhm.rb @alecthomas Formula/qrgo.rb @afollestad Formula/radiography.rb @tcmulcahy @zach-klippenstein diff --git a/Formula/ghost.rb b/Formula/ghost.rb new file mode 100644 index 0000000..7e470cc --- /dev/null +++ b/Formula/ghost.rb @@ -0,0 +1,35 @@ +# Release metadata is managed by .github/workflows/bump-formula.yaml. +# Avoid manual edits to `url`, `sha256`, and `version`; the bump workflow rewrites them. +# Run: gh workflow run bump-formula.yaml -f repo=block/ghost -f formula=ghost -f tag= -f artifact_url= [-f sha256=] + +class Ghost < Formula + desc "Product-surface composition fingerprints, checks, review, and comparison" + homepage "https://github.com/block/ghost" + url "https://github.com/block/ghost/releases/download/anarchitecture-ghost@0.11.1/anarchitecture-ghost-0.11.1.tgz" + sha256 "940bb6a9008598a11e70a0ee67753a722770ef75099e2711e46de52a73a5e5b6" + license "Apache-2.0" + version "0.11.1" + + depends_on "node" + + def install + # The release artifact is the published npm tarball, which extracts to a + # `package/` directory containing the built `dist/` and `package.json`. + # Ship those into libexec, install the (pure-JS) runtime deps, and link + # the CLI entrypoint onto the PATH. + libexec.install Dir["package/*"] + + cd libexec do + system "npm", "install", *std_npm_args(prefix: false), "--omit=dev", "--no-audit", "--no-fund" + end + + (libexec/"dist/bin.js").chmod 0755 + bin.install_symlink libexec/"dist/bin.js" => "ghost" + end + + test do + assert_path_exists bin/"ghost" + assert_predicate bin/"ghost", :executable? + assert_match "ghost/#{version}", shell_output("#{bin}/ghost --version") + end +end