A flexible CLI tool for organizing React projects with different architectural patterns.
You can run this tool directly using npx:
npx rorg
On first run, you'll be prompted to:
- Choose your preferred architectural pattern
- Specify the base path for components (e.g., src, app)
- Decide if you want test files for each component
- Choose whether to use separate CSS files
These preferences will be saved in .rorg-config.json
. After initialization, rerun the command to start generating components.
npx rorg atom
npx rorg molecule
npx rorg organism
npx rorg template
npx rorg page
npx rorg component
npx rorg page
npx rorg feature
npx rorg shared
Depending on your chosen pattern, the tool will create one of these structures (under your specified base path):
<basePath>/
components/
atoms/
molecules/
organisms/
templates/
pages/
<basePath>/
components/
pages/
<basePath>/
features/
feature-name/
components/
hooks/
utils/
shared/
The tool creates a .rorg-config.json
file in your project root after initialization. This file stores:
- Your chosen architectural pattern
- The base path for components
- Whether to include test files
- Whether to use separate CSS files
Example configuration:
{
"pattern": "atomic",
"basePath": "src",
"includeTests": true,
"separateCss": true,
"initialized": "2023-09-20T12:34:56.789Z"
}