Skip to content
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

dev-cmd/create: add --node option #7990

Merged
merged 1 commit into from Jul 19, 2020
Merged

Conversation

SeekingMeaning
Copy link
Contributor

@SeekingMeaning SeekingMeaning commented Jul 13, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Allows for brew create --node https://registry.npmjs.org/cubejs-cli/-/cubejs-cli-0.19.48.tgz

Based on #7787 (thanks @vladimyr!!)

Library/Homebrew/.rubocop.yml Outdated Show resolved Hide resolved
@jonchang
Copy link
Member

jonchang commented Jul 18, 2020

Looking at the usage of std_npm_install_args in Homebrew/core, I'm not sure that adding a std_npm_args to Formula would help all that much. This will change e.g.

require "languages/node"
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]

to

system "npm", "install", *std_npm_args
bin.install_symlink Dir["#{libexec}/bin/*"]

I think this addition to the Formula API will obscure that std_npm_args is installing to libexec. Perhaps dropping std_npm_args and only making the relevant changes to brew create would be clearer?

rg -A1 std_npm_install_args
Formula/imageoptim-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/imageoptim-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/fauna-shell.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/fauna-shell.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/cdk8s.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/cdk8s.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/gitter-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/gitter-cli.rb-    bin.install_symlink libexec/"bin/gitter-cli"
--
Formula/marked.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/marked.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/ungit.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/ungit.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/bit.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/bit.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/bower.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/bower.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/svgo.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/svgo.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/newman.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/newman.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/whistle.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/whistle.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/joplin.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec),
Formula/joplin.rb-                             "--sqlite=#{Formula["sqlite"].opt_prefix}"
--
Formula/insect.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/insect.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/coffeescript.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/coffeescript.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/netlify-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/netlify-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/hsd.rb:    system "#{Formula["node@10"].bin}/npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/hsd.rb-    (bin/"hsd").write_env_script libexec/"bin/hsd", :PATH => "#{Formula["node@10"].opt_bin}:$PATH"
--
Formula/tdkjs.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/tdkjs.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/bitwarden-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/bitwarden-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/contentful-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/contentful-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/eslint.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/eslint.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/jhipster.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/jhipster.rb-    bin.install Dir["#{libexec}/bin/*"]
--
Formula/firebase-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/firebase-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/grunt-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/grunt-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/pulp.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/pulp.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/now-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/now-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/atomist-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/atomist-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/sloc.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/sloc.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/serverless.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/serverless.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/generate-json-schema.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/generate-json-schema.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/autorest.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/autorest.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/pnpm.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/pnpm.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/angular-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/angular-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/graphql-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/graphql-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/cubejs-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/cubejs-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/jsdoc3.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/jsdoc3.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/triton.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/triton.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/terrahub.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/terrahub.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/autocode.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/autocode.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/http-server.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/http-server.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/lerna.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/lerna.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/cash-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/cash-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/aws-cdk.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/aws-cdk.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/webpack.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/webpack.rb-
--
Formula/typescript.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/typescript.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/prettier.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/prettier.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/quicktype.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/quicktype.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/appium.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/appium.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/balena-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/balena-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/gitmoji.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/gitmoji.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/write-good.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/write-good.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/babel.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/babel.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/gulp-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/gulp-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/alexjs.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/alexjs.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/apollo-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/apollo-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/ask-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/ask-cli.rb-    bin.write_exec_script libexec/"bin/ask"
--
Formula/node-sass.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/node-sass.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/bcoin.rb:    system "#{Formula["node"].libexec}/bin/npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/bcoin.rb-    (bin/"bcoin").write_env_script libexec/"bin/bcoin", :PATH => "#{Formula["node"].opt_bin}:$PATH"
--
Formula/nativefier.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/nativefier.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/ios-sim.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/ios-sim.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/fx.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/fx.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/gatsby-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/gatsby-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/jsonlint.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/jsonlint.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/react-native-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/react-native-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]
--
Formula/webtorrent-cli.rb:    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
Formula/webtorrent-cli.rb-    bin.install_symlink Dir["#{libexec}/bin/*"]

@SeekingMeaning
Copy link
Contributor Author

SeekingMeaning commented Jul 18, 2020

Yeah that makes sense. I wasn't sure myself if std_npm_args would be helpful

@jonchang jonchang merged commit 9156154 into Homebrew:master Jul 19, 2020
2 checks passed
@SeekingMeaning SeekingMeaning deleted the node branch Jul 19, 2020
@MikeMcQuaid
Copy link
Member

MikeMcQuaid commented Jul 20, 2020

Looks good nice work!

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 23, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants