Git Product home page Git Product logo

hygen-add's Introduction

hygen-add

hygen-add is one of the tools in the Hygen toolbelt which allows you to add pre-made generator packages to your project.

Quick Start

Install:

$ yarn add --dev hygen-add

And add a package:

$ hygen-add test-package

What's Defines a Package?

A package can be a Git repository, path (location), or a node module. In all cases, a package needs:

  • To have a package.json file that is installable by Yarn.
  • To have a _templates folder where your generators will be.

Naming Your Package

Since there are two options to use (Git and npm), using Git you can end up with a repository that's named one thing, and the package in it is named another thing.

Here's how to treat all cases.

As a Node Module

If you decide to push your package as a proper node module, then you must prefix its name as hygen-YOURNAME, and installing it will be:

$ hygen-add YOURNAME

We use the hygen- prefix to avoid trashing the node module ecosystem, and to allow for easy search. Meaning, you can search for hygen- to get a listing of all packages on a node module registry.

As a Git Repo

If you decide to publish as a Git repo, you can use hygen-add like this:

$ hygen-add https://github.com/jondot/foo-bar

A name of a package, even if it's on a Git repo and was never pushed to npm, is still the same name that is specified in your package.json file.

With that in mind any repo works and there's no special naming rules for the repo itself. In this case the default name for the package will be foo-bar and taken directly from the Git repo address.

If you have a different name within the actual package in the repo, you can override the default and specify a name:

$ hygen-add https://github.com/jondot/not-a-name --name best-generator

Contributing

Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).

Thanks:

To all Contributors - you make this happen, thanks!

Copyright

Copyright (c) 2018 Dotan Nahum @jondot. See LICENSE for further details.

hygen-add's People

Contributors

jondot avatar

Watchers

James Cloos avatar

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.