New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-factory-cli

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-factory-cli

CLI for creating and managing React projects and components

Source
npmnpm
Version
1.2.3
Version published
Maintainers
1
Created
Source

React Factory CLI

Imagine you're about to start a new React project, and instead of spending time configuring everything from scratch, you run a single command, and your project is set up, fully equipped with Tailwind CSS for utility-first styling and SCSS for custom CSS. That’s exactly what React Factory CLI offers.

React Factory CLI is a versatile command-line tool that simplifies the process of scaffolding and managing React projects. It allows developers to quickly generate functional, class-based, pages, services, context APIs, and hooks with minimal effort. A standout feature of React Factory CLI is the rfc-config.json file, which lets you customize your project’s folder structure and default component types.

React Factory CLI offers a complete React boilerplate setup via a simple setup command, including:

  • Tailwind CSS for fast UI design and SCSS for custom styling.
  • Routing with middlewareWrapper for enhanced route handling.
  • Built-in hooks like debounce and title.
  • Theme Context API for global theme management.
  • Pre-built services like token management and HTTP service with token integration.
  • Environment configuration for local, staging, and production.

React Factory CLI is evolving, and with every release, it's becoming more than just a helper; it’s a tool that shapes the way developers build modern React applications.

Table of Contents

  • Installation
  • Usage
  • Roadmap

Installation

To use React Factory CLI, install it globally or locally.

Global Installation

npm install -g react-factory-cli

Local Installation

To use it locally in your project:

npm install react-factory-cli --save-dev

Then, you can run it with npx:

npx react-factory-cli <operation> <name> [options...]

Usage

Run the CLI using the following syntax:

react-factory-cli <operation> <name> [options...]

RFC Config

{
  "component": {
    "path": "src/components",
    "type": "functional"
  },
  "page": {
    "path": "src/components",
    "type": "functional"
  },
  "service": {
    "path": "src/services"
  },
  "context": {
    "path": "src/context"
  },
  "hook": {
    "path": "src/hooks"
  }
}

Available Commands

CommandAliasDescription
setupN/ASetup a new React project with tailwind css and scss
generate:componentgcGenerates a new React component
generate:pagegpGenerates a new React page component
generate:servicegsGenerates a new React service
generate:contextgctxGenerates a new React Context API
generate:hookghGenerates a new React hook

Command Options

CommandOptionDescription
setup--path <name>Specify the folder to create the project in (default: current folder)
generate:component, gc-f, --functionalGenerate a functional component
generate:component, gc-c, --classGenerate a class-based component
generate:component, gc-p, --path <location>Generate a component in a different location

Examples

  • Setup a new React project:

    rfc setup --path my-react-app
    
  • Generate a functional component:

    rfc gc myComponent --functional
    
  • Generate a service:

    rfc gs api
    
  • Generate a Context API:

    rfc gctx auth
    
  • Generate a custom hook:

    rfc gh custom
    

Contributing

Contributions are welcome! To contribute to React Factory CLI, feel free to fork the repository and submit a pull request.

Keywords

react

FAQs

Package last updated on 29 Sep 2024

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