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

reacling

v2.0.2

Published

cli utility for generating react project structure

Downloads

15

Readme

reacling

Description

It is a cli utility that generates various parts of your React project such as component folders, hooks, etc. Also it can be used fo generate Feature Sliced Design structure.

Usage

# Command example
$ yarn reacling c <component name>

# Options:
 --help  Show available commands

Commands for simple project

  • Generate a component: $ yarn reacling c <component name>
  • Generate a page: $ yarn reacling p <page name>
  • Generate a hook: $ yarn reacling h <hook name>
  • Generate a config file: $ yarn config
  • Get help: $ yarn reacling --help

Commands for Feature-Sliced Design project

  • Generate FSD structure: $ yarn reacling init
  • Generate a page: $ yarn reacling p <page name>
  • Generate a widget: $ yarn reacling w <widget name>
  • Generate a entity: $ yarn reacling e <entity name>
  • Generate a feature: $ yarn reacling f <feature name>
  • Generate a component shortcut: $ yarn reacling eu | fu <component path>
  • Generate a component for entity: $ yarn reacling eu <entity name> <component name>
  • Generate a component for feature: $ yarn reacling fu <feature name> <component name>
  • Generate a component for shared: $ yarn reacling su <component name>
  • Generate a hook for slice: $ yarn reacling h <hook name> <slice-path>
  • Generate a config file: $ yarn config
  • Get help: $ yarn reacling --help

Feature-Sliced Design

You can generate reacling.json by executing $ yarn reacling config. Use this config to provide custom structure of project.

This is default settings for FSD structure:
    "methodology": "fsd",
    "fsdStructure": {
      "app": { "withProviders": true },
      "pages": {
        "withLib": true,
        "withUi": true
      },
      "widgets": {
        "withLib": true,
        "withUi": true
      },
      "features": {
        "withApi": true,
        "withLib": true,
        "withModel": true,
        "withUi": true
      },
      "entities": {
        "withApi": true,
        "withLib": true,
        "withModel": true,
        "withUi": true
      }
    }
}
You can provide your oun settings using this interface:
interface SliceStructure {
  withApi?: boolean
  withAssets?: boolean
  withConfig?: boolean
  withLib?: boolean
  withUi?: boolean
  withModel?: boolean
}

type Methodology = 'simple' | 'fsd'

interface ReaclingConfig {
  methodology?: Methodology
  fsdStructure?: {
    app?: {
      withProviders?: boolean
    }
    entities?: SliceStructure
    features?: SliceStructure
    widgets?: SliceStructure
    pages?: SliceStructure
  }
}
For example:

The command $ yarn reacling init provide us next folders structure: alt text