npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-factory-cli

v1.2.5

Published

CLI for creating and managing React projects and components

Downloads

38

Readme

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, interface, test file, 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.
  • Implement Prettier configuration to ensure consistent code formatting.
  • Set up component testing with Jest for robust testing coverage.
  • Integrate SEO tags into each page component for improved search engine visibility.

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

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"
  },
  "interface": {
    "path": "src/utils/interfaces"
  },
  "test": {
    "path": "src" // if existing project set root folder and define test file path while creating using command `rfc gt components/User/user` or `rfc gt test/user`
  }
}

Available Commands

| Command | Alias | Description | | --------------------- | ------ | ---------------------------------------------------- | | setup | N/A | Setup a new React project with tailwind css and scss | | generate:component | gc | Generates a new React component | | generate:page | gp | Generates a new React page component | | generate:service | gs | Generates a new React service | | generate:context | gctx | Generates a new React Context API | | generate:hook | gh | Generates a new React hook | | generate:intterface | gi | Generates a new Interfaces | | generate:test | gt | Generates a new test file |

Command Options

| Command | Option | Description | | ------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------- | | setup | --path <name> | Specify the folder to create the project in (default: current folder) | | generate:component, gc, generate:page, gp | -f, --functional | Generate a functional component or page component | | generate:component, gc, generate:page, gp | -c, --class | Generate a class-based component or page component | | generate:component, gc, generate:page, gp | -p, --path <location> | Generate a component or page component in a different location | | generate:component, gc, generate:page, gp | -t, --test | Generate a component or page component with test files | | generate:page, gp | -seo, --seoTag | Generate a page component include seo tags |

Examples

  • Setup a new React project:

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

    rfc gc myComponent --functional
    • Generate a functional page component:
    rfc gp myComponent --functional --seoTag --test
  • Generate a service:

    rfc gs api
  • Generate a Context API:

    rfc gctx auth
  • Generate a custom hook:

    rfc gh custom
    • Generate a interface:
    rfc gi custom
    • Generate a test file:
    rfc gt custom

Contributing

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