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

rrmb-generator

v2.1.13

Published

React Redux Module Based Generator. This module created to help developers avoid redudent work releated with component, module, container... generation.

Downloads

34

Readme

React Redux Module Based Generator (rrmb-generator)

Generator for module based code for redux, Inspired by scalable-react-boilerplate

Install

npm install rrmb-generator

Open package json and add generate command within the scripts option

"scripts": {
    "generate": "generate",
    "generate:component": "npm run generate component",
    "generate:container": "npm run generate container",
    "generate:page": "npm run generate page"
}

Why

There are different typef of generator to help create react and redux based application. They are doing great job with action, enums and reducers generation, but based on exist experince we belive that module based structuring is more relaiable way to go. This generator created in mind to provide efficient way for page, container and component generation.

Generators

The package contains generators for easy project scaffolding. Generator help to generate following components.

  • Container npm run generate:container
    • Name: the name of the container, i.e. Awesome, which converts to: AwesomeContainer
    • Connected / Not connected ES6 Class containers (higher order)
    • SCSS Modules
    • Modules
  • Component npm run generate:component
    • Name: the name of the component, i.e. Button
    • Stateless functional components (recommended)
    • ES6 class components
    • SCSS modules
    • Tests for all of the above
  • Page npm run generate:page
    • Name: The name of the route, i.e. Home, which gets converted to HomePage

To run the generators with a list of options, run

npm run generate

Follow the on screen prompts to select the options you wish to use.

For convenience, you can bypass the initial selection and scaffold out containers, components and pages by running

npm run generate:<type_of_component>

where <type_of_component> is one of: component, container or page.

The generators use the same feature-first file organization as the rest of the project, encapsulating components within their own folder.

More

If you want to add routing for generating pages follow the steps In your route file add pages import

import * as Pages from 'some/dir/pages';

Then leave the bot mark (// BOT: NEXT ROUTE) in place where new routes should be added

<Provider store={store}>
    <Router history={history}>
      <Route path="/" component={App}>
        <IndexRoute component={Pages.WelcomePage} />
        <Route path="login" component={Pages.LoginPage} />
        // BOT: NEXT ROUTE
        <Route path="*" component={Pages.NotFoundPage} />
      </Route>
    </Router>
  </Provider>

Configs

The generators output paths can be configured in two ways.

package.json

You just need create rrmb properties in package.json file and give relative paths

 "rrmb": {
    "paths": {
      "componentsDir": "src/components/"
    }
  }

.rrmb

Create ".rrmb" file in the root directory (where package.json is)

Set your custom configs there as json data

{
	"paths": {
		"componentsDir": "src/components/",
		"containersDir": "src/containers/",
		"pagesDir": "src/pages/",
		"modulesDir": "src/modules/",
		"testRootDir": "__test__/",
		"routeFile": "src/routes.js"
	}
}