npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hygen-cook

v1.5.0

Published

Helps you cook up some delicious hygen recipes

Downloads

20

Readme

test-and-publish

🧑‍🍳 hygen-cook

A composition tool for hygen templates. Allows you to compose and generate complex services from many small modular hygen generators.

Introduction

Hygen is great for templating out small bits of boilerplate for specific use cases, but less than ideal for large complex projects with multiple different options. Hygen Cook aims to solve that issue by allowing you to define a recipe for that large complex project by combining multiple small generators in a specific shape and order.

Contents

What is a Recipe?

A recipe is composed of two main sections, ingredients and instructions. Ingredients specifies which generators will be used in the recipe, either by git url or npm package name. Instructions specifies the calls to those generators and the arguments they require. When you have a recipe file and want to cook the recipe, simply call hygen-cook and pass it the recipe, pretty soon you'll have a freshly baked project to start working on.

Usage

Install

To get the hygen-cook command available in your terminal you'll need to install the module globally:

npm i -g hygen-cook

Create a Recipe

name: My API
ingredients:
  - https://github.com/hygen-generators/scaffolder-demo-hygen
  - github-actions-generators
instructions:
  - ingredient: scaffolder-demo-hygen
    generator: monorepo
    action: new
    args:
      - option: name
        value: simple-service
  - ingredient: scaffolder-demo-hygen
    generator: monorepo-package
    action: new
    basePath: packages/api
    args:
      - option: name
        value: api
  - ingredient: scaffolder-demo-hygen
    generator: monorepo-package
    action: lambda
    basePath: packages/api
    args:
      - option: name
        value: api-lambda
      - option: component
        value: api
  - ingredient: scaffolder-demo-hygen
    generator: monorepo-package
    action: new
    basePath: packages/ingest
    args:
      - option: name
        value: ingest
  - ingredient: scaffolder-demo-hygen
    generator: monorepo-package
    action: lambda
    basePath: packages/ingest
    args:
      - option: name
        value: ingest-lambda
      - option: component
        value: ingest
  - ingredient: github-actions-generators
    generator: github-actions
    action: build-test-publish
    args:
      - option: admin-github-token
        value: SUPER_SECRET_TOKEN
      - option: main-branch
        value: main
      - option: node-version
        value: '14.11'
      - option: use-commit-lint
      - option: use-lerna
  - ingredient: github-actions-generators
    generator: github-actions
    action: dependabot
    args:
      - option: admin-github-token
        value: SUPER_SECRET_TOKEN
      - option: main-branch
        value: main
      - option: node-version
        value: '14.11'
  - ingredient: github-actions-generators
    generator: github-actions
    action: terraform-deploy
    args:
      - option: admin-github-token
        value: SUPER_SECRET_TOKEN
      - option: main-branch
        value: main

Time to cook

hygen-cook -r path/to/my-api-recipe.yml

CLI Ref

hygen-cook --help
Options:
      --version             Show version number                        [boolean]
  -r, --recipe              The recipe to cook up            [string] [required]
      --overwriteTemplates  Should overwrite templates?
                                                      [boolean] [default: false]
      --help                Show help                                  [boolean]

Example Recipes

Some example recipes for you to try out using open source generators

A node module with github actions to build, test, and publish

name: a-shiny-new-module
node: &vNode '16.14.2'
ingredients:
  - &gha hygen-github-action-generators
  - &nodemod hygen-node-module-generators
instructions:
  - ingredient: *gha
    generator: gha-workflows
    action: new
    args:
      - option: name
        value: workflows
      - option: nodeVersion
        value: *vNode
  - ingredient: *nodemod
    generator: node-module
    action: new
    args:
      - option: name
        value: shiny-new-module
      - option: description
        value: A shiny new module to do awesome things
      - option: author
        value: You <[email protected]>
      - option: repoName
        value: https://github.com/bbeesley/awesome-generators
      - option: nodeVersion
        value: *vNode
      - option: supportNodeVersion
        value: '14.18.3'

A monorepo for multiple packages with github actions to build, test, and publish

name: a-shiny-set-of-modules
node: &vNode '16.14.2'
repo: &repo 'https://github.com/bbeesley/awesome-generators'
ingredients:
  - &gha hygen-github-action-generators
  - &nodemod hygen-node-module-generators
instructions:
  - ingredient: *gha
    generator: gha-workflows
    action: new
    args:
      - option: name
        value: workflows
      - option: nodeVersion
        value: *vNode
  - ingredient: *nodemod
    generator: node-module
    action: new
    args:
      - option: name
        value: root
      - option: description
        value: Root package for lerna
      - option: author
        value: You <[email protected]>
      - option: repoName
        value: *repo
      - option: nodeVersion
        value: *vNode
      - option: supportNodeVersion
        value: '14.18.3'
      - option: isLernaRoot
        value: 'true'
  - ingredient: *nodemod
    generator: node-module
    action: new
    basePath: packages/a-monorepo-package
    args:
      - option: name
        value: a-monorepo-package
      - option: description
        value: One of the packages in my monorepo
      - option: author
        value: You <[email protected]>
      - option: repoName
        value: *repo
      - option: nodeVersion
        value: *vNode
      - option: supportNodeVersion
        value: '14.18.3'
      - option: isLernaChild
        value: 'true'
  - ingredient: *nodemod
    generator: node-module
    action: new
    basePath: packages/another-monorepo-package
    args:
      - option: name
        value: another-monorepo-package
      - option: description
        value: Another of the packages in my monorepo
      - option: author
        value: You <[email protected]>
      - option: repoName
        value: *repo
      - option: nodeVersion
        value: *vNode
      - option: supportNodeVersion
        value: '14.18.3'
      - option: isLernaChild
        value: 'true'