Gathering detailed insights and metrics for hygen-cook
Gathering detailed insights and metrics for hygen-cook
Gathering detailed insights and metrics for hygen-cook
Gathering detailed insights and metrics for hygen-cook
npm install hygen-cook
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
18
38
1
A composition tool for hygen templates. Allows you to compose and generate complex services from many small modular hygen generators.
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.
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.
To get the hygen-cook
command available in your terminal you'll need to install the module globally:
1npm i -g hygen-cook
1name: My API 2ingredients: 3 - https://github.com/hygen-generators/scaffolder-demo-hygen 4 - github-actions-generators 5instructions: 6 - ingredient: scaffolder-demo-hygen 7 generator: monorepo 8 action: new 9 args: 10 - option: name 11 value: simple-service 12 - ingredient: scaffolder-demo-hygen 13 generator: monorepo-package 14 action: new 15 basePath: packages/api 16 args: 17 - option: name 18 value: api 19 - ingredient: scaffolder-demo-hygen 20 generator: monorepo-package 21 action: lambda 22 basePath: packages/api 23 args: 24 - option: name 25 value: api-lambda 26 - option: component 27 value: api 28 - ingredient: scaffolder-demo-hygen 29 generator: monorepo-package 30 action: new 31 basePath: packages/ingest 32 args: 33 - option: name 34 value: ingest 35 - ingredient: scaffolder-demo-hygen 36 generator: monorepo-package 37 action: lambda 38 basePath: packages/ingest 39 args: 40 - option: name 41 value: ingest-lambda 42 - option: component 43 value: ingest 44 - ingredient: github-actions-generators 45 generator: github-actions 46 action: build-test-publish 47 args: 48 - option: admin-github-token 49 value: SUPER_SECRET_TOKEN 50 - option: main-branch 51 value: main 52 - option: node-version 53 value: '14.11' 54 - option: use-commit-lint 55 - option: use-lerna 56 - ingredient: github-actions-generators 57 generator: github-actions 58 action: dependabot 59 args: 60 - option: admin-github-token 61 value: SUPER_SECRET_TOKEN 62 - option: main-branch 63 value: main 64 - option: node-version 65 value: '14.11' 66 - ingredient: github-actions-generators 67 generator: github-actions 68 action: terraform-deploy 69 args: 70 - option: admin-github-token 71 value: SUPER_SECRET_TOKEN 72 - option: main-branch 73 value: main
1hygen-cook -r path/to/my-api-recipe.yml
1hygen-cook --help 2Options: 3 --version Show version number [boolean] 4 -r, --recipe The recipe to cook up [string] [required] 5 --overwriteTemplates Should overwrite templates? 6 [boolean] [default: false] 7 --help Show help [boolean] 8
Some example recipes for you to try out using open source generators
1name: a-shiny-new-module 2node: &vNode '16.14.2' 3ingredients: 4 - &gha hygen-github-action-generators 5 - &nodemod hygen-node-module-generators 6instructions: 7 - ingredient: *gha 8 generator: gha-workflows 9 action: new 10 args: 11 - option: name 12 value: workflows 13 - option: nodeVersion 14 value: *vNode 15 - ingredient: *nodemod 16 generator: node-module 17 action: new 18 args: 19 - option: name 20 value: shiny-new-module 21 - option: description 22 value: A shiny new module to do awesome things 23 - option: author 24 value: You <you@your.com> 25 - option: repoName 26 value: https://github.com/bbeesley/awesome-generators 27 - option: nodeVersion 28 value: *vNode 29 - option: supportNodeVersion 30 value: '14.18.3' 31
1name: a-shiny-set-of-modules 2node: &vNode '16.14.2' 3repo: &repo 'https://github.com/bbeesley/awesome-generators' 4ingredients: 5 - &gha hygen-github-action-generators 6 - &nodemod hygen-node-module-generators 7instructions: 8 - ingredient: *gha 9 generator: gha-workflows 10 action: new 11 args: 12 - option: name 13 value: workflows 14 - option: nodeVersion 15 value: *vNode 16 - ingredient: *nodemod 17 generator: node-module 18 action: new 19 args: 20 - option: name 21 value: root 22 - option: description 23 value: Root package for lerna 24 - option: author 25 value: You <you@your.com> 26 - option: repoName 27 value: *repo 28 - option: nodeVersion 29 value: *vNode 30 - option: supportNodeVersion 31 value: '14.18.3' 32 - option: isLernaRoot 33 value: 'true' 34 - ingredient: *nodemod 35 generator: node-module 36 action: new 37 basePath: packages/a-monorepo-package 38 args: 39 - option: name 40 value: a-monorepo-package 41 - option: description 42 value: One of the packages in my monorepo 43 - option: author 44 value: You <you@your.com> 45 - option: repoName 46 value: *repo 47 - option: nodeVersion 48 value: *vNode 49 - option: supportNodeVersion 50 value: '14.18.3' 51 - option: isLernaChild 52 value: 'true' 53 - ingredient: *nodemod 54 generator: node-module 55 action: new 56 basePath: packages/another-monorepo-package 57 args: 58 - option: name 59 value: another-monorepo-package 60 - option: description 61 value: Another of the packages in my monorepo 62 - option: author 63 value: You <you@your.com> 64 - option: repoName 65 value: *repo 66 - option: nodeVersion 67 value: *vNode 68 - option: supportNodeVersion 69 value: '14.18.3' 70 - option: isLernaChild 71 value: 'true' 72
No vulnerabilities found.
No security vulnerabilities found.