generator-reackt
v1.3.0
Published
Create an opinionated React-based web applcication
Maintainers
Readme
The Reactor - An Opinionated Generator
This project scaffolds a modern web application. It is fairly opinionated, but is customizable and extensible.
Here's the mile-long list of technologies the generated project can leverage:
- TypeScript - The language of the modern web
- Webpack - Bundle code, styles, markup, and more
- React - Application framework library
Linting tools:
- ESLint - Apply hundreds of style/usage rules to JS/TS
- Prettier - Apply style/formatting rules to code
- stylelint - Apply style/usage rules to Sass
Optional pre-commit linting:
- husky - Execute lint-staged before committing to Git
- lint-staged - Execute linters for specific file types
Optional style frameworks:
Optional test frameworks:
- Jest - Unit, integration, and snapshot testing
- React Testing Library - Opinionated unit testing for React
Optional state management:
- Redux - Application state container
- Redux-Saga - Redux middleware for action/side-effect interaction
Installation
npm install -g generator-reackt
OR
yarn add -g generator-reackt
Usage
To create an application, run yo reackt.
To create a new React component, run yo reackt:component. You will be asked for a React component name, and whether or not to include a test case or Storybook story if applicable.
To create a new page, run yo reackt:page. You will be asked for a page name and a URL, and the page is registered in src/routes.tsx so that it is routable and shows up in the navigation bar.
If you are using Redux, you can create a new module (slice of reducer and sagas) with yo reackt:module. You will be asked for a module name, and whether or not to include a test case and/or a Storybook story if applicable. You will also be asked if you want to structure your module in dir format or file format. An example:
file format
The default. The reducer will be written to ./src/reducers/example.tsx.
dir format
The reducer will be written to ./src/reducers/example/index.tsx.
Useful when you want to break the reducers out further into specific files.
