All Projects → howardroark → Pollinate

howardroark / Pollinate

Licence: unlicense
Template your base files and generate new projects from Git(Hub).

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pollinate

Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (+11.74%)
Mutual labels:  project, boilerplate, generator, yeoman, scaffolding
Project Name
Get the name of a project from package.json, git config, or basename of the current working directory.
Stars: ✭ 8 (-96.24%)
Mutual labels:  project, generator, yeoman, scaffolding
Microgen
♻️ micro-generator for individual files, easy like sunday morning 🌅
Stars: ✭ 85 (-60.09%)
Mutual labels:  generator, yeoman, scaffolding, templates
Yo
CLI tool for running Yeoman generators
Stars: ✭ 3,421 (+1506.1%)
Mutual labels:  generator, yeoman, scaffolding, templates
Sao
⚔ Futuristic scaffolding tool
Stars: ✭ 966 (+353.52%)
Mutual labels:  boilerplate, generator, yeoman, scaffolding
Create Graphql
Command-line utility to build production-ready servers with GraphQL.
Stars: ✭ 441 (+107.04%)
Mutual labels:  cli, boilerplate, yeoman
Vim Doge
(Do)cumentation (Ge)nerator 10+ languages 📚 Generate proper code documentation skeletons with a single keypress. ⚡️🔥
Stars: ✭ 533 (+150.23%)
Mutual labels:  boilerplate, generator, skeleton
Reactprimer
React component prototyping tool that generates fully connected class component code.
Stars: ✭ 743 (+248.83%)
Mutual labels:  boilerplate, generator, skeleton
Generate Gh Repo
Generate generator to create a new repository on GitHub.
Stars: ✭ 11 (-94.84%)
Mutual labels:  project, generator, scaffolding
Extension Create
Create modern cross-browser extensions with no build configuration.
Stars: ✭ 167 (-21.6%)
Mutual labels:  cli, boilerplate, generator
Generator Modular Angular
A truly modular yeoman generator for AngularJS all device apps.
Stars: ✭ 23 (-89.2%)
Mutual labels:  generator, yeoman, scaffolding
Samples Viewer Generator
🎉 A CLI utility tool to generate web app of data visualization samples for presentation purpose
Stars: ✭ 13 (-93.9%)
Mutual labels:  cli, boilerplate, generator
Graphback
Graphback - Out of the box GraphQL server and client
Stars: ✭ 323 (+51.64%)
Mutual labels:  cli, schema, generator
Proji
A powerful cross-platform CLI project templating tool.
Stars: ✭ 156 (-26.76%)
Mutual labels:  cli, project, scaffolding
justgo
Skeleton for jump-starting a Go-powered microservice project with Docker and Go best-practices + easy code hot-reloading (for dev environments)!
Stars: ✭ 29 (-86.38%)
Mutual labels:  generator, templates, scaffolding
Relay Fullstack
☝️🏃 Modern Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS
Stars: ✭ 986 (+362.91%)
Mutual labels:  boilerplate, yeoman, scaffolding
Cgx
💻🔥CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (-10.8%)
Mutual labels:  cli, generator, templates
Forge
F# CLI tool for project, file, and solution management
Stars: ✭ 233 (+9.39%)
Mutual labels:  cli, project, scaffolding
Create Elm App
🍃 Create Elm apps with zero configuration
Stars: ✭ 1,650 (+674.65%)
Mutual labels:  cli, boilerplate, scaffolding
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+523.94%)
Mutual labels:  cli, generator, yeoman

Pollinate

Generate a new project directly from Git(Hub) using a simple schema.

npm version Build Status Dependency Status

What?

It is a command that takes a templated tree of files and generates them for new projects using data defined by a simple schema. The data can define an output name, files to discard, files to parse with the data, and files to move or rename. The template can supply the default data, and that data can be extended for each project. You can throw in any other data you'd like to be passed to the template context as well.

All templates are parsed with Nunjucks aka Jinja and Twig.

Why?

When starting new projects the quickest way is often to just copy the last project and fiddle with it until it works. This can introduce many unwanted issues, like having one client's name appear in place of the other's. This project's goal is to offer an elegant and efficient way of working with a base set of files that can be understood by looking at a single example.

Install

$ npm install -g pollinate

An example

$ pollinate howardroark/webapp --name newproject --image alpine --description="A thing that does something."

Skip to more examples...

The GitHub sourced template
.
├── PROJECT-README
├── README.md
├── Dockerfile
├── project-name
└── template.json
template.json (optional)
{
  // Core schema
  "name": "webapp",
  "parse": [
    "PROJECT-README",
    "Dockerfile"
  ],
  "discard": [
    "README.md",
    "template.json"
  ],
  "move": [
    { "PROJECT-README": "README.md" },
    { "project-name": "{{ name }}.txt" }
  ],
  // Custom defaults
  "image": "debian",
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}

You can omit any or all of discard, parse and move.

PROJECT-README
# {{ name }}

{{ description }}
Dockerfile
FROM {{ image }}
The project data
{
  "name": "newproject",
  "image": "alpine",
  "description": "A thing that does something."
}
The data after extending and parsing
{
  "name": "newproject",
  "parse": [
    "Dockerfile",
    "PROJECT-README"
  ],
  "discard": [
    "README.md",
    "template.json"
  ],
  "move": [
    { "PROJECT-README": "README.md" },
    { "project-name": "newproject.txt" }
  ],
  "image": "alpine",
  "description": "A thing that does something."
}
The result
.
└── newproject
   ├── README.md
   ├── newproject.txt
   └── Dockerfile
README.md
# newproject

A thing that does something.
Dockerfile
FROM alpine

More options

You can specify template files as a local directory (.git will be removed)

$ pollinate ./template --name newproject --image ubuntu

You can use any Git url (.git will be removed)

$ pollinate https://github.com/howardroark/webapp.git --name newproject --image ubuntu

You can pass project data as a file

$ pollinate howardroark/webapp data.json

You can pass project data as a JSON string

$ pollinate howardroark/webapp '{"name":"newproject","image":"alpine","description":"A thing that does a thing."}'

You can pass project data as a JSON endpoint

$ pollinate howardroark/webapp https://example.com/json/data

You can generate from the default data in the template

$ pollinate howardroark/webapp

You can override data as CLI options

$ pollinate howardroark/webapp data.json --name=alternate --image=ubuntu

You can specify a command to run on completion

{
  "complete": "git init {{ name }}"
}

You can supply user specific data each time with a ~/.pollen defaults file

{
  "api_key":"secret"
}

You can preserve the commit history from the skeleton project with the --keep-history CLI option or:

{
  keepHistory: true
}

Filters

You can supply custom Nunjucks filter functions (files must be included within template)

{
  "filters": {
    "markdown": "filters/markdown.js"
  }
}
filters/markdown.js
var markdownParser = function() { ... }

module.exports = function(markdownText) {
  var html = markdownParser(markdownText)
  return '<div class="markdown">'+html+'</div>'
}

Parse

All parse paths are first passed to globby

{
  "parse": ["*"]
}
{
  "parse": [
    "*",
    "!templates"
  ]
}

Merge

You can specify .json files to merge

package.json

{
  "name": "@howardroark/webapp",
  "version": "1.0.0",
  "description": "project for testing pollinate with merge",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/howardroark/webapp.git"
  },
  "author": "Andy Edwards",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/howardroark/webapp/issues"
  },
  "homepage": "https://github.com/howardroark/webapp#readme",
  "dependencies": {
    "lodash": "^4.17.4"
  }
}

PROJECT-package.json

{
  "name": "@{{ organization }}/{{ name }}",
  "version": "1.0.0",
  "description": "{{ description }}",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/{{ organization }}/{{ name }}.git"
  },
  "author": "{{ author }}",
  "bugs": {
    "url": "https://github.com/{{ organization }}/{{ name }}/issues"
  },
  "homepage": "https://github.com/{{ organization }}/{{ name }}#readme",
}

template.json

{
  "name": "webapp",
  "description": "project for testing pollinate with merge",
  "organization": "howardroark",
  "author": "Andy Edwards",
  "parse": [
    "PROJECT-package.json"
  ],
  "merge": [
    ["package.json", "PROJECT-package.json"]
  ],
  "discard": [
    "PROJECT-package.json"
  ]
}

command

pollinate howardroark/webapp#merge-test --name myapp --description 'my new app' --organization myorg --author Me

This will overwrite package.json with the contents of package.json and PROJECT-package.json merged with lodash.merge. This is useful when you want to keep template variables out of package.json, since they would cause certain npm commands to fail.

Resulting package.json

{
  "name": "@myorg/myapp",
  "version": "1.0.0",
  "description": "my new app",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/myorg/myapp.git"
  },
  "author": "Me",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/myorg/myapp/issues"
  },
  "homepage": "https://github.com/myorg/myapp#readme",
  "dependencies": {
    "lodash": "^4.17.4"
  }
}

Thanks

  • @binhood for the fantastic work on the logo!
  • @jedwards1211 for the handy object merge option :)
  • @ben657 for refactoring a bunch of stuff :o
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].