momkai-cli

3.0.2 • Public • Published

Momkai CLI tools

This repository contains a Momkai Command Line Interface for generating new projects as well as new components, stories and contexts.

Usage

New projects

To use this CLI to create a new project, simply run:

npx momkai-cli create

To use this CLI in an existing project, the generation commands need a config file defining the component and context folder paths. This config file can be generated by running:

npx momkai-cli init

You will then be prompted for the file paths and the config file will be added automatically.

Generation commands

The Momkai CLI supports the following commands to generate new files using our own templates defined in the ./templates folder.

  • To generate a component
    npx momkai-cli generate component <ComponentName>
    
  • To generate a new context
    npx momkai-cli generate context <ContextName>
    

Configuration

The CLI configuration is obtained from the momkai-cli-settings.json file in the main folder of your project. This config file contains the necessary path definitions to generate new components or other files. To add this configuration manually, create the file yourself and make sure to define the paths like this:

{
  "components": {
    "path": "components"
  },
  "context": {
    "path": "contexts"
  },
  "styles": {
    "global": {
      "path": "styles/global.scss"
    }
  }
}

Next steps

  • [ ] Add story generation as a separate command
  • [ ] Explore indexing and generating .stories.js files for existing components.
  • [ ] Explore what documentation should be generated.

Readme

Keywords

none

Package Sidebar

Install

npm i momkai-cli

Weekly Downloads

4

Version

3.0.2

License

ISC

Unpacked Size

14.7 kB

Total Files

18

Last publish

Collaborators

  • lennartdeknikker