Git Product home page Git Product logo

create-from-blueprint's Introduction

Create from Blueprint CircleCI

BETA version disclaimer: This package is still very volatile, use with caution.

Gives ability to copy a file structure into a certain path renaming the file paths and the files' content.

Can be used with React to provide component and container blueprints, in which case creating a new component is done with a single command instead of manually creating and filling all the files. This has the added benefit of providing teams the ability to offer and enforce common patterns for developers.

Getting started

Install

yarn add -D create-from-blueprint
npm i --save-dev create-from-blueprint

Usage

1. Define blueprints in your package.json

{
  "createFromBlueprint": {
    "component": "blueprints/component/",
    "container": "blueprints/container/"
  }
}

key
Type of the blueprint (component, container)

value
A path pointing to an existing folder (blueprints/component/, ...)

2. Run the command

create-from-blueprint <destination>

2.1. You'll be asked to choose a type from a list1
2.2. And input a name

Instances of type, beginning with a lowercase or uppercase letter, will be replaced with name

  • In file paths: Every instance of {% type %} will be replaced with name for the files within the folder the blueprint config targets
  • In file contents: Every instance of type will be replaced with name

1 The list consists of keys from the config field

Further details

Commander --help output

  $ create-from-blueprint --help

  Usage: create-from-blueprint [options] <destination>

  Options:

    -n, --name <name>  The name of the created component
    -t, --type <type>  The name of the component type defined in the config
    -h, --help         output usage information

When type or name is missing, both will be asked for with inquirer. You can input everything in one go as well by providing both (type, name) of the options.

create-from-blueprint -t component -n InvoiceItem components

Inspiration

Django's startapp which automatically generates a base for a new application.

Built with

License

This project is licensed under the MIT License - see the license file for details

TODO

  • Single file blueprint support

create-from-blueprint's People

Contributors

jokinen avatar

Watchers

 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.