Giter Site home page Giter Site logo

gadd's Introduction

Gadd

github add
download and install packages from a github monorepo

the best way to install a npm package from a monorepo

npx gadd <username/repo> --path packages/library

# Example: install React from github.com/facebook/react

npx gadd facebook/create-react-scripts -p packages/react-dev-utils

Why tho

Big epic projects like react, jest, babel, expo, etc. keep their packages in a monorepo under the packages/ directory. These packages cannot be installed directly using NPM or Yarn which makes it awkward and hard to test them without being published. Both NPM and Yarn should probably add first-class support for this feature but they don't ๐Ÿ˜ So for now you can use gadd.

How

gadd is a super light-weight package that clones the GitHub tar to a temporary folder, then extracts the tar into a .gadd folder in your project. After that gadd installs the package using your package manager tool of choice!

  • Modules are installed in your project's .gadd/ folder.
  • You can add .gadd/ to your .gitignore to keep the dev modules out of your git history.
  • Big repos can take a while to install, this is cuz GitHub doesn't support downloading individual folders.
  • You can install any repo by ommitting the --path arg, but it might make more sense to just install the package directly with NPM.

Flags

Usage: gadd <project-root> [options]

Downloads and installs NPM packages from GitHub monorepos

Options:
  -V, --version      output the version number
  -p, --path [name]  The path inside of a GitHub repo where the package lives.
  -d, --dev          Install as a dev dependency
  --use-npm          Use npm to install dependencies. (default when Yarn is not installed)
  --no-install       Skip installing npm packages after extracting.
  -h, --help         output usage information

gadd's People

Contributors

evanbacon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gadd's Issues

How to define a branch name

I assume

npx gadd react-navigation/react-navigation -p packages/core

Downloads and installs the react-navigation package from the default branch. What if we want to install it from a specific branch?
Would be great if we had a parameter like -b to define the branch name, or -t to define a tag.

Private repo

Nice work here! Already used and it works smoothly! But do you have any intention on adding private repo usability?

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.