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

rfs-cli

v1.0.0

Published

React File Structure CLI tool

Downloads

8

Readme

RFS-CLI (React File Structure CLI)

RFS-CLI is a command-line tool designed to quickly generate a standardized file structure for React projects. It creates a consistent folder and file organization for pages, higher-order components (HOCs), and regular components.

Features

  • Automatically generates a structured directory layout for React projects
  • Creates boilerplate files for pages, HOCs, and components
  • Ensures consistent naming conventions across your project
  • Generates TypeScript files with basic React component structure
  • Provides verbose output option for detailed creation process information
  • Compatible with all versions of React

Installation

You can install RFS-CLI globally using npm:

npm install -g rfs-cli

Or using yarn:

yarn global add rfs-cli

Usage

After installation, you can use the rfs command followed by the module name you want to create:

rfs <module-name> [options]

Options

  • -v, --verbose: Enable verbose output for detailed information about the creation process.

Example

To create a module named "UserProfile":

rfs UserProfile

This will create the following structure:

src/
├── pages/
│   └── userProfile/
│       ├── userProfile.page.tsx
│       └── index.ts
├── hoc/
│   └── userProfile/
│       ├── userProfile.hoc.tsx
│       └── index.ts
└── components/
    └── userProfile/
        ├── userProfile.content.tsx
        └── index.ts

Project Structure

RFS-CLI generates the following structure for each module:

  • pages/: Contains page components
  • hoc/: Contains Higher-Order Components
  • components/: Contains regular React components

Each directory contains:

  • A main component file (e.g., userProfile.page.tsx)
  • An index.ts file for easy importing

Development

To set up the project for development:

  1. Clone the repository:

    git clone https://github.com/shiref209/rfs-cli.git
  2. Install dependencies:

    cd rfs-cli
    npm install
  3. Link the package locally:

    npm link

Now you can use rfs command in your terminal, and it will use your local development version.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the ISC License.

Author

Sherif Hamam [email protected]

React Compatibility

RFS-CLI is designed to work with all versions of React. However, please note that some generated code might use features from newer React versions. If you're using an older version of React, you may need to adjust the generated code accordingly.

Issues

If you encounter any problems or have suggestions, please file an issue on the GitHub repository.

Acknowledgements

Thanks to my senior Mostafa Sadeik who inspired me for this CLI and taught me the structure that I've been using for a year now.