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-clix

v1.0.2

Published

A CLI tool for scaffolding React projects with Redux and RTK Query.

Downloads

40

Readme

React-CLIX

React-CLIX is a CLI tool to scaffold React projects with Redux and RTK Query. It provides useful commands to streamline React development, including setting up Redux, RTK Query, and creating React components easily.

Installation

To install react-clix globally, run:

npm install -g react-clix

Alternatively, if you do not want to install it globally, you can install it locally in your project:

npm install react-clix --save-dev

After installing locally, you can run the commands using npx:

npx react-clix <command>

Commands

1. create-app <name>

Creates a new React application with an optional TypeScript setup.

Global Usage:

react-clix create-app my-app

Local Usage:

If you have installed react-clix locally in your project, run:

npx react-clix create-app my-app

Options:

  • -t, --typescript: Use a TypeScript template for the project.

Example:

react-clix create-app my-app -t

Or, using npx for local installation:

npx react-clix create-app my-app -t

2. init-redux

Initializes a Redux store in an existing React project. This command will create a store.js file in the src directory, including basic Redux setup and configuration.

Global Usage:

react-clix init-redux

Local Usage:

If react-clix is installed locally, run:

npx react-clix init-redux

Example:

cd my-existing-react-app
react-clix init-redux

Or:

cd my-existing-react-app
npx react-clix init-redux

3. add-rtk-api <apiName>

Adds a new RTK Query API with the specified name to the Redux store. It generates the API slice in the src/services/ directory and sets up everything for you.

Global Usage:

react-clix add-rtk-api <apiName>

Local Usage:

If react-clix is installed locally, run:

npx react-clix add-rtk-api <apiName>

Example:

react-clix add-rtk-api authApi

Or:

npx react-clix add-rtk-api authApi

4. create-slice <sliceName>

Creates a new Redux slice with the specified name and integrates it into the Redux store. It also updates the necessary files to include hooks for easy usage within React components.

Global Usage:

react-clix create-slice <sliceName>

Local Usage:

If react-clix is installed locally, run:

npx react-clix create-slice <sliceName>

Example:

react-clix create-slice userSlice

Or:

npx react-clix create-slice userSlice

5. create-component <componentName>

Generates a new React component in the specified path under the src directory. By default, it creates the component in the src/components folder. You can also specify a relative path.

Global Usage:

react-clix create-component <componentName>

Local Usage:

If react-clix is installed locally, run:

npx react-clix create-component <componentName>

Options:

  • -p, --path <path>: Relative path from the src directory where the component should be created.

Example:

react-clix create-component MyComponent -p components/ui

Or:

npx react-clix create-component MyComponent -p components/ui

Examples

  1. Creating a New React App:

    Global:

    react-clix create-app MyNewApp -t

    Locally:

    npx react-clix create-app MyNewApp -t
  2. Initializing Redux in an Existing App:

    Global:

    cd MyExistingApp
    react-clix init-redux

    Locally:

    cd MyExistingApp
    npx react-clix init-redux
  3. Adding an RTK Query API:

    Global:

    react-clix add-rtk-api productsApi

    Locally:

    npx react-clix add-rtk-api productsApi
  4. Creating a Redux Slice:

    Global:

    react-clix create-slice cartSlice

    Locally:

    npx react-clix create-slice cartSlice
  5. Creating a React Component:

    Global:

    react-clix create-component Button -p components/common

    Locally:

    npx react-clix create-component Button -p components/common

Installation for Development

If you are developing react-clix or want to modify it:

  1. Clone the repository:

    git clone https://github.com/yourusername/react-clix.git
  2. Install the dependencies:

    npm install
  3. To test your CLI tool locally, link it globally:

    npm link

This will allow you to use react-clix commands globally on your machine.

Contributing

Contributions are welcome! Please open an issue or submit a pull request to contribute to the project.

License

This project is licensed under the MIT License - see the LICENSE file for details.