Skip to content

Commit af10cae

Browse files
authored
Merge pull request #36 from khus29/patch-2
Update generate-plop.md
2 parents 07c9818 + 75a9fd3 commit af10cae

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

docs/generate-plop.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,43 @@ javascript files as well by passing --js in script command.
1111

1212
## Workflow diagram
1313

14-
![generate-plop](https://s10.gifyu.com/images/workflow.png)
14+
![generate-plop](https://s10.gifyu.com/images/workflow928767aefb9d6b3d.png)
1515

16+
17+
## Feature Details
18+
You can generate the following components using generate-plop
19+
20+
- React Components: Class and Functional in [Atomic Design](https://atomicdesign.bradfrost.com/) structure.
21+
- React Custom Hooks.
22+
- React Context.
23+
- React Query Services.
24+
- Next.js Pages/Routes.
25+
26+
You can use this generator in a single app repo as well as in a monorepo
27+
(powered by [turborepo](https://turborepo.org/)).
28+
generate-plop is intelligent enough to figure out if it being run in single app repo
29+
or in the root directory of monorepo.
30+
31+
If it is a monorepo, you will be asked to choose the from the application in ```` /apps````
32+
annd ```` /packages```` directories where you wish to create the component.
33+
34+
After the app selection workflow of monorepo is same as the workflow in single repo application.
35+
The workflow is explaied below.
36+
37+
### Components
38+
As of now, the Current version creates react-components only. You can create [Functional
39+
or Class components](https://reactjs.org/docs/components-and-props.html).
40+
- You can create atoms or molecules or organisms or templates.
41+
- Any of the above categories you choose, tool expects directory ````/src/{category}````
42+
to be available.
43+
- You can create react component at the custom path as well. You will need to enter
44+
a custom path relative to ````/src```` directory.
45+
In the last step, you will need to provide the name of the componentt.
46+
47+
Based on all details provided generate-tool will create follwoing files:
48+
- ````index.ts```` Export statement for the component.
49+
- ````{name}.ts````React component
50+
- ````tests/{name}.test.ts```` Unit test basic structure for the component using [React Test Library](https://testing-library.com/docs/react-testing-library/intro/)
51+
- ````{name}.style.ts```` Style file for the component using [Styled Component framework](https://styled-components.com/)
52+
- ````{name}.story.ts```` [Storybook](https://storybook.js.org/) created for the component.
53+

0 commit comments

Comments
 (0)