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

@grabantot/react-cli

v1.2.1

Published

Automate components management routine

Downloads

22

Readme

react-cli

Installation

npm i -g @grabantot/react-cli

Usage

animation gif

Usage: react-cli [options] [command] <path/Component>

Manage react components and related files

Options:
  -V, --version  output the version number
  -f, --func     create functional component or convert the existing class component to functional
  -c, --class    create class component or convert the existsing functional component to class
  -s, --style    create style module and add 'import styles' to the component
  -i, --index    add component export to index.js in its directory
  -h, --help     output usage information

Commands:
  config <path>  set directory for templates and config file; will be filled with defaults if empty

Global config location: '/home/tot/.react-cli/config.json'.

Examples:
  $ react-cli -fs src/components/views/Primitives/Button
  $ react-cli -csi src/components/views/User/UserCard
  $ react-cli config path/to/empty/dir/to/put/react-cli-config-and-templates

Config options (react-cli.config.json):

{
  "useSemicolons": false,
  "componentExtension": ".js",
  "styleModuleExtension": ".module.scss"
}

Todo

Per directory configs. Configurable names for templates.

Commands:

  • mv - move/rename the component and related files, fix imports in the project

Options:

  -p, --prop-types  find props used in render and add propTypes for them
  -r, --redux       connect the component to the redux store
  -S, --story       create storybook story for the component
  -P, --pure        make the component pure (use recompose's pure for functional components)
  -t, --test        add tests for the component

Assumptions

  • Components are default exports in files
  • Functional components are defined as function ComponentName(props)
  • ...

No assumptions about the project structure.

Contribute

It's 2019 and still there is no decent react cli. Yet all the appropriate names for such a package on npm are taken.

Let's fix this. Contributions of any kind are welcome: add features, add tests, refactor the code or simply share you thoughts in issues.

Related projects

Less related: