-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat(packaging): add Homebrew formula and Scoop manifest for react-debugger CLI #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| class ReactDebugger < Formula | ||
| desc "Advanced debugging & performance optimization tool for ReactJS applications" | ||
| homepage "https://github.com/hoainho/react-debugger-extension" | ||
| url "https://registry.npmjs.org/@nhonh/react-debugger/-/react-debugger-2.1.2.tgz" | ||
| sha256 "5398bdb6ce914c39d147ea52ba1d7d235d0292d49433dc077cbd1b58300f6f16" | ||
| license "MIT" | ||
|
|
||
| depends_on "node" | ||
|
|
||
| def install | ||
| system "npm", "install", "--production", "--ignore-scripts" | ||
| libexec.install Dir["*"] | ||
|
|
||
| (bin/"react-debugger").write <<~SH | ||
| #!/bin/sh | ||
| exec node "#{libexec}/bin/cli.js" "$@" | ||
| SH | ||
| end | ||
|
|
||
| test do | ||
| assert_match "2.1", shell_output("#{bin}/react-debugger --version") | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| { | ||||||
| "version": "2.1.2", | ||||||
| "description": "Advanced debugging & performance optimization tool for ReactJS applications - Chrome Extension", | ||||||
| "homepage": "https://github.com/hoainho/react-debugger-extension", | ||||||
| "license": "MIT", | ||||||
| "suggest": { | ||||||
| "Node.js": [ | ||||||
| "main/nodejs", | ||||||
| "main/nodejs-lts" | ||||||
| ] | ||||||
| }, | ||||||
| "installer": { | ||||||
| "script": [ | ||||||
| "npm install --global @nhonh/react-debugger@2.1.2 --prefix \"$dir\" --ignore-scripts 2>&1 | Out-Null", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding the version
Suggested change
|
||||||
| "if (!(Test-Path \"$dir\\bin\")) { New-Item -ItemType Directory -Path \"$dir\\bin\" | Out-Null }", | ||||||
| "@'", | ||||||
| "@echo off", | ||||||
| "node \"%~dp0..\\node_modules\\.bin\\react-debugger\" %*", | ||||||
| "'@ | Set-Content \"$dir\\bin\\react-debugger.cmd\"" | ||||||
| ] | ||||||
| }, | ||||||
| "bin": "bin\\react-debugger.cmd", | ||||||
| "checkver": { | ||||||
| "url": "https://registry.npmjs.org/@nhonh/react-debugger/latest", | ||||||
| "jsonpath": "$.version" | ||||||
| }, | ||||||
| "autoupdate": { | ||||||
| "note": "Update version field and re-run checkver to pick up new npm releases." | ||||||
| }, | ||||||
| "notes": [ | ||||||
| "react-debugger requires Node.js >= 18.", | ||||||
| "Install Node.js first: scoop install nodejs-lts" | ||||||
| ] | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a bare
nodecommand in the shell wrapper relies on whatevernodebinary happens to be in the user'sPATHat runtime. Since this formula explicitly declaresdepends_on "node", it is safer and more robust to use the absolute path to the Homebrew-managed Node binary.