Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

matchabot

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matchabot

## Introduction

  • 0.2.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

MatchaBot

Introduction

MatchaBot is a code generator. You can use matchabot to create an entire project, or to generate code inside an existing project in a consistent way.

MatchaBot

Features

  • ✅ Easy to use in project generator
  • HandleBars support
  • ✅ Powerfull command line support

Benefits

  • ✅ Simple
  • ✅ Boost your productivty
  • ✅ Fun to use 🦄

Key concepts

  • 👉 A code generator is identified by a command.
  • 👉 A command takes a list of arguments as input and execute a list of generator actions ⚙️.
  • 👉 ️️A generator action is specified by one or multiple templates written with a templating language such as HandleBars or EJS
  • 👉 The generators definitions are stored inside your project inside the ./.machatbot directory
  • 👉 Each command is defined by a matcha.json file inside the ./.machatbot directory

How to start

Add matchabot to your project

Execute the following command at the root of your project.

yarn add matchabot --dev

Initialise matchabot

Execute the following command at the root of your project.

matchabot init

👉 This command create a local directory ./.matchabot inside your project

./.matchabot
└── commands
    ├── add-command
    ├── add-licence

The command directory contains a list of subdirectory. Each subdirectory contains a matcha.json file that defines the command and a list of asociated templates.

Example ./.matchabot/add-licence/matcha.json:

{
  "name": "add-licence",
  "description": "add a licence file to your project",
  "version": "1.0.0",
  "args": [
    {
      "name": "CopyRightsHolder",
      "alias": "c",
      "type": "string",
      "default": "{{process.env.LOGNAME}}"
    },
    {
      "name": "ProgramDescription",
      "alias": "p",
      "type": "string"
    },
    {
      "name": "LicenceType",

      "type": "list",
      "choices": [
        { "name": "MIT License", "value": "mit" },
        { "name": "BSD License", "value": "bsd" },
        { "name": "Apache License, Version 2.0", "value": "apache2" },
        { "name": "GNU General Public License version 3", "value": "gnu3" }
      ],
      "default": "MIT"
    }
  ],
  "actions": [
    {
      "type": "template",
      "name": "Generate Licence",
      "source": "{{toLowerCase LicenceType}}.md.hbs",
      "target": "LICENCE.md"
    }
  ]
}

List availables commands

matchabot list

👉 This command gives the list of defined commands

  __  __       _       _             ____        _
 |  \/  | __ _| |_ ___| |__   __ _  | __ )  ___ | |_
 | |\/| |/ _` | __/ __| '_ \ / _` | |  _ \ / _ \| __|
 | |  | | (_| | || (__| | | | (_| | | |_) | (_) | |_
 |_|  |_|\__,_|\__\___|_| |_|\__,_| |____/ \___/ \__|

Version: 0.2.0 🍵

┌─────────┬──────────────────────────┬──────────────────────────────────────────────────────────────┬─────────┬────────────────────────────────────────────────┐
│ (index) │           name           │                         description                          │ version │                    location                    │
├─────────┼──────────────────────────┼──────────────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────────┤
│    0    │      'add-command'       │       'add a new command to the .matchabot directory'        │ '1.0.0' │      './.matchabot/commands/add-command'       │
│    1    │      'add-licence'       │             'add a licence file to your project'             │ '1.0.0' │      './.matchabot/commands/add-licence'       │
│    2    │    'create-react-app'    │               'create a typescript react app'                │ '1.0.0' │    './.matchabot/commands/create-react-app'    │
│    3    │ 'create-react-component' │ 'generate a Styled React Component, and an associated story' │ '1.0.0' │ './.matchabot/commands/create-react-component' │
└─────────┴──────────────────────────┴──────────────────────────────────────────────────────────────┴─────────┴────────────────────────────────────────────────┘

Execute a command

matchabot add-licence

Keywords

FAQs

Package last updated on 01 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc