Giter Club home page Giter Club logo

homebrew-npm-noob's Introduction

homebrew-npm-noob

PyPI License Build Status

homebrew-npm-noob generates a Homebrew formula for an npm package. It is inspired by homebrew-pypi-poet.

Installation

Either

pip install homebrew-npm-noob

or

brew install zmwangx/npm-noob/noob

Usage

$ noob --help
usage: noob [-h] [-w] [-t TAP] [-v] [--debug] package

Generate a Homebrew formula for an npm package. By default the generated
formula is printed to stdout. If -w, --write is specified, the formula is
directly written to the specified tap, or homebrew/core if no tap is
specified.

positional arguments:
  package            name of the package on npm

optional arguments:
  -h, --help         show this help message and exit
  -w, --write        write to filesystem instead of stdout
  -t TAP, --tap TAP  if writing to filesystem, write to this tap instead of
                     homebrew/core
  -v, --version      show program's version number and exit
  --debug

Example

$ noob babel-cli
require "language/node"

class BabelCli < Formula
  desc "Babel command line"
  homepage "https://babeljs.io/"
  url "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz"
  sha256 "81ac501721ff18200581c58542fa6226986766c53be35ad8f921fabd47834d02"
  license "MIT"

  livecheck do
    url :stable
  end

  depends_on "node"

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

  test do
    raise "Test not implemented."
  end
end

See Also

Node for Formula Authors in Homebrew's docs.

License

homebrew-npm-noob is released under the MIT license. See COPYING for details.

homebrew-npm-noob's People

Contributors

zmwangx avatar jorgegonzalez avatar tommyang avatar

Stargazers

 avatar JD Hawke avatar Alan.He avatar João Palmeiro avatar Milad Nekofar avatar Adriano Cahete avatar 任侠 avatar Kishan B avatar Daniel Bayley avatar ffdsouza avatar Rodolfo Ovalles avatar Ben avatar MAPKIN avatar Igor Gentil avatar nitrocode avatar Raosan Fikri avatar Robert DeLuca avatar Grégory Heitz avatar  avatar Lynsei avatar Alex Capaldo avatar Blake E avatar Daniel Esser avatar Alexander Swensen avatar Michael Salaverry avatar Aaron Martel avatar Stephan van Rooij avatar Zubair Quraishi avatar Daniel Choudhury avatar weakish avatar Petr Plavjaník avatar Eddie Ramirez avatar  avatar Mark Thomas avatar eg avatar Hexen Qi avatar Tom Hummel avatar TANIGUCHI Masaya avatar Artem Medvedev avatar

Watchers

 avatar  avatar

homebrew-npm-noob's Issues

Cannot install with `brew`

Installing works fine with pip, but with brew I get the following rather obscure error:

brew install zmwangx/npm-noob/noob
==> Tapping zmwangx/npm-noob
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/zmwangx/homebrew-npm-noob'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 111 (delta 0), reused 2 (delta 0), pack-reused 107
Receiving objects: 100% (111/111), 36.09 KiB | 924.00 KiB/s, done.
Resolving deltas: 100% (49/49), done.
Tapped 1 formula (23 files, 140.5KB).
==> Fetching zmwangx/npm-noob/noob
==> Downloading https://github.com/zmwangx/homebrew-npm-noob/archive/v0.3.tar.gz
==> Downloading from https://codeload.github.com/zmwangx/homebrew-npm-noob/tar.gz/refs/tags/v0.3
#=#=- #     #                                                                                                                                                 
==> Installing noob from zmwangx/npm-noob
==> python3 -m venv --system-site-packages --without-pip /home/linuxbrew/.linuxbrew/Cellar/noob/0.3/libexec
==> /home/linuxbrew/.linuxbrew/Cellar/noob/0.3/libexec/bin/pip install .
Last 15 lines from /home/rrt/.cache/Homebrew/Logs/noob/02.pip:
2024-02-13 20:53:01 +0000

/home/linuxbrew/.linuxbrew/Cellar/noob/0.3/libexec/bin/pip
install
.


If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/zmwangx/homebrew-npm-noob/issues

There's no error message I can see here, other than telling me where to report it, and the exit code being 1.

Take into account node version constraint

Hello,

Currently, this application is relying on depends_on "node" to pull the dependency.

Here is the feature request: parse package.json and retrieve this section so that the formula output contains depends_on "node@16" instead.

  "engines": {
    "node": "<17"
  },

Deprecation in formula

I'm getting this error every time I run brew update:

Warning: Calling 'depends_on :python3' is deprecated!
Use 'depends_on "python3"' instead.
/usr/local/Homebrew/Library/Taps/zmwangx/homebrew-npm-noob/Formula/noob.rb:9:in `<class:Noob>'
Please report this to the zmwangx/npm-noob tap!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.