All Projects → coolassassin → reactcci

coolassassin / reactcci

Licence: MIT License
React create component interactive CLI

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to reactcci

Larawiz
Larawiz is a easy project scaffolder for Laravel
Stars: ✭ 28 (-42.86%)
Mutual labels:  generator, scaffolding
Yii2 Enhanced Gii
Enhanced Yii2 Gii (generator) that generates related Models & CRUD
Stars: ✭ 183 (+273.47%)
Mutual labels:  generator, scaffolding
Sao
⚔ Futuristic scaffolding tool
Stars: ✭ 966 (+1871.43%)
Mutual labels:  generator, scaffolding
Generator Modular Angular
A truly modular yeoman generator for AngularJS all device apps.
Stars: ✭ 23 (-53.06%)
Mutual labels:  generator, scaffolding
Assemble
Community
Stars: ✭ 3,995 (+8053.06%)
Mutual labels:  build, generator
Project Name
Get the name of a project from package.json, git config, or basename of the current working directory.
Stars: ✭ 8 (-83.67%)
Mutual labels:  generator, scaffolding
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (+87.76%)
Mutual labels:  generator, scaffolding
Microgen
♻️ micro-generator for individual files, easy like sunday morning 🌅
Stars: ✭ 85 (+73.47%)
Mutual labels:  generator, scaffolding
gradle-upgrade-interactive
CLI to interactively upgrade gradle dependencies, inspired by yarn.
Stars: ✭ 44 (-10.2%)
Mutual labels:  build, interactive
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 (+385.71%)
Mutual labels:  generator, scaffolding
Yo
CLI tool for running Yeoman generators
Stars: ✭ 3,421 (+6881.63%)
Mutual labels:  generator, scaffolding
Vue Generate Component
Vue js component generator
Stars: ✭ 206 (+320.41%)
Mutual labels:  components, generator
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 (-40.82%)
Mutual labels:  generator, scaffolding
Generate Gh Repo
Generate generator to create a new repository on GitHub.
Stars: ✭ 11 (-77.55%)
Mutual labels:  generator, scaffolding
Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (+334.69%)
Mutual labels:  generator, scaffolding
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (+95.92%)
Mutual labels:  build, generator
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+416.33%)
Mutual labels:  components, generator
win-svn
apache subversion windows builds with httpd modules and java hl
Stars: ✭ 19 (-61.22%)
Mutual labels:  build
iakit
无依赖 mini 组件库,只封装了 alert, toast, loading, actionSheet 等使用频率较高的组件。适用于类似 H5 活动页的简单移动端项目,不必为了使用这些组件而引入一个大而全的 UI 库和框架。
Stars: ✭ 38 (-22.45%)
Mutual labels:  components
laravel-livewire-ui
Laravel Livewire UI, Auth, & CRUD starter kit.
Stars: ✭ 92 (+87.76%)
Mutual labels:  scaffolding

React create component interactive CLI

CLI to create or edit React or React Native components with your own structure

  • Plug and play: Instant config for CRA with typescript
  • Easy to config: interactive configuration and simple templating
  • Works with anything: Typescript, Storybook, Redux, Jest, ...
  • Lightweight: < 30kb + 3 small libraries
  • Fast search: very fast selecting place for new component by dynamic search
  • A lot by one command: ton of files by multi-creation feature
  • Created for React: better than plop, hygen or any scaffolding library, because it's for React
  • Multiplatform: Works on MacOS, Windows, and Linux.
  • VSCode Extension
  • Webstorm integration

Example

Tests Status Build Status Version FOSSA Status

Quick Overview

Via yarn and interactive mode

$ yarn add -D reactcci
$ yarn rcci

or via npm and flags

$ npm i -D reactcci
$ npx rcci --name Header Body Footer --dest src/App

Installation

To install via npm:
npm install --save-dev reactcci

To install via yarn:
yarn add --dev reactcci

Config

On first run CLI will ask you about automatic configuration. Just run a command:
npx rcci
This command creates file rcci.config.js and template folder with basic template set.

Config file contains next parameters:

  • folderPath
    Root directory to place you components, or array of paths
    Default: src/

  • templatesFolder
    Path to your own components templates
    Default: templates

  • multiProject
    Allows you to set up config for mono-repository with several projects
    Default: false

  • skipFinalStep
    Allows you to switch off last checking step
    Default: false

  • templates
    Object with structure of your component

  • processFileAndFolderName
    String or function which allows you to remap your component name to folder-name and file-name prefix
    Default: PascalCase
    Types:

    • camelCase
    • PascalCase
    • snake_case
    • dash-case
    • (name: string, parts: string[], isFolder: boolean) => string

    Example:

    {
        ...config,
        processFileAndFolderName: (name, parts, isFolder) => 
            isFolder ? name : parts.map((part) => part.toLowerCase()).join('-')
    }
  • placeholders
    List of placeholders which you can use to build your own component template
    Default:
    #NAME# for a component name
    #STYLE# for css-module import
    #STORY_PATH# for storybook title

  • afterCreation
    Object with scripts to process you file after creation
    Default: undefined
    Example:

    {
        ...config,
        afterCreation: {                
            prettier: {
                extensions: ['.ts', '.tsx'], // optional
                cmd: 'prettier --write [filepath]'
            }
        }
    }

Placeholders

Each placeholder is a function which get some data to build your own placeholder.
During the multiple component creation all functions will be called for every single component.
Example:

placeholders: {
    NAME: ({ componentName }) => componentName
}

After this set up you are able to use this placeholder by #NAME# inside your template files.
Below, you can see the list of all available data and functions to create a new one.

Field Description
project Project name in multy-project mode
componentName,
objectName
Name of the component or another object in multi-template mode
objectType Type of object which was selected by user. It is component by default.
pathToObject path to objects folder
Example: src/components
destinationFolder relative path to folder of object which is being created
Example: App/Header/Logo
objectFolder Absolute path to your object (component) folder
relativeObjectFolder Relative path to your object (component) folder
filePrefix processed object(component) name for filename
folderName processed object(component) name for folder
files Object of files which is being created
getRelativePath(to: string) Function to get relative path to any another path
Example: ../../src/helpers
join(...parts: string) Function to get joined parts of path.
Example:
join(project, destinationFolder, componentName) => Project/Footer/Email
stringToCase(str: string, toCase: string) Function to map any string to case.
Example:
stringToCase('dash-case-string', 'PascalCase') => DashCaseString

Arguments

  • --update, -u
    To activate update mode to add new files to component or to replace existing
  • --dest, -d
    To set absolute or destination path to create or update component
  • --skip-search, -s
    To skip interactive folder selection to use dest argument as is
  • --name, -n
    To set component name or names divided by space to create several
  • --files, -f
    To set files to create or update, instead interactive selection
    Example: --files style test component[1]
    Will create optional files like style and test and will select second type of component by index
  • --project, -p
    To set project in multi-project mode
  • --sls
    To skip last agreement step like skipFinalStep in config file

Multi-template

If you need to generate something else, not components only, you are able to set up array of templates.
Example bellow:

{
    ...config,
    templates: [
        {
            name: 'component', // will be added to default folderPath folder
            files: {
                index: {
                    name: 'index.ts',
                    file: 'component.ts'
                }
            }
        },
        {
            name: 'service',
            folderPath: 'services/', // will be added by the specific path
            files: {
                index: {
                    name: 'index.ts',
                    file: 'service.ts'
                }
            }
        }
    ]
}

License

FOSSA Status

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].