# @jonjoe/module-generator

> Component generator for react components

Latest version **1.6.1** (published 2020-05-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @jonjoe/module-generator
pnpm add @jonjoe/module-generator
yarn add @jonjoe/module-generator
bun add @jonjoe/module-generator
```

Provides the command `react-component-generator`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.1 |
| Published | 2020-05-30 |
| First published | 2020-05-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 29.3 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jonjoe Whitfield |
| Maintainers | jonjoe |

## Links

- npm: https://www.npmjs.com/package/@jonjoe/module-generator
- Repository: https://github.com/jonjoe/module-generator
- Homepage: https://github.com/jonjoe/module-generator#readme
- Issues: https://github.com/jonjoe/module-generator/issues
- npm.io page: https://npm.io/package/@jonjoe/module-generator

## Dependencies (4)

- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [simple-git](https://npm.io/package/simple-git.md) ^1.132.0
- [replace-in-file](https://npm.io/package/replace-in-file.md) ^5.0.2
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.1.1

## Recent versions

- 1.6.1 (latest) — 2020-05-30

## README

# React Component Generator

This is an attempt to clean up one of my internal tools that I use regularly for all kinds of work. It is a work in progress and evolving all the time but the general idea is to help maintain a standard when creating React components. Consistancy is super important and this is my attempt to codify some of the rules I have naturally fallen into over the years. 

Until I extend this package to work with different repos for more diverse component setups the outputted files will look like this:

```
  After running react-component-generator name="Button" path="./src/components/atoms"

  src/
    components/
      atoms/
        Button/
          index.ts <-- exports component
          Button.component.tsx. <-- component code here
          Button.styles.tsx. <-- component styles here
          Button.stories.tsx. <-- component storybook
          Button.spec.tsx. <-- component tests
        ...
      ...
    ...

```

## Install
Due to github packages being stupid. This cannot be installed via NPM. I will update this week. 


## Usage

#### Lv 1 Mafia

After installing you can just use the cli. Running the command will generate a react componet with soime boilerplace files.

```
react-component-generator name="Button" path="./src/components/atoms"

```

#### Lv 99 Mafia

if you wanna be super fancy you could use this from within your project or globally. I personally use this within my own projects. For example in my package.json I will have something like:

```
...
  "scripts": {
    ...
      "generate:atom": "react-component-generator path='./src/components/atoms'",
      "generate:molecule": "react-component-generator path='./src/components/molecules'",
      "generate:organism": "react-component-generator path='./src/components/organisms'",
      "generate:template": "react-component-generator path='./src/components/templates'",
      "generate:layout": "react-component-generator path='./src/components/layouts'"
    ...
  }
...
```

## Note-worthy Notes

- React boilerplate code is generated from this repo https://github.com/Jonjoe/react-base-functional-component. If you want to make any suggestions on changes to this please go there.

## Todo

- Auto import and export from component root folder manifest
- Add optional parameters to pick a different repo to clone from
- Moar feedback!

---
_Source: https://npm.io/package/@jonjoe/module-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
