Skip to content

Commit 8f3df6a

Browse files
committed
updated the contribution guide
1 parent 892b392 commit 8f3df6a

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

CONTRIBUTING.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
> ⚠️ This guide is old and may not be still relevant! I'll update this soon. 🙏
2-
31
# Contributing to RetroUI
42

53
Thank you for your interest in contributing to RetroUI 🙏. I hope this guide to help you get started.
@@ -26,7 +24,7 @@ Thank you for your interest in contributing to RetroUI 🙏. I hope this guide t
2624
git switch -c new-branch-name
2725
```
2826

29-
5. nstall dependencies
27+
5. install dependencies
3028

3129
```bash
3230
pnpm i
@@ -42,46 +40,60 @@ Thank you for your interest in contributing to RetroUI 🙏. I hope this guide t
4240
1. Create the main component in `/packages/ui/NewComponent/NewComponent.tsx`
4341

4442
```ts
45-
import React from 'react'
46-
4743
export function NewComponent() {
48-
return (
49-
<div>
50-
This is your component.
51-
</div>
52-
)
44+
return <div>This is your component.</div>;
5345
}
5446
```
5547

5648
2. Export your component in `/packages/ui/NewComponent/index.ts` and `/packages/ui/index.ts`
5749

5850
```ts
59-
export * from "./NewComponent"
51+
export * from "./NewComponent";
6052
```
6153

62-
3. Create basic example to showcase your component in `app/page.tsx`
54+
3. Create a preview to showcase your component in `preview/components/new-component.tsx`
6355

6456
```typescript
65-
import React from "react";
66-
import { H3, NewComponent } from "@/packages/ui";
67-
68-
export default function page() {
57+
export default function NewComponentStyle() {
6958
return (
70-
<div className="container max-w-6xl mx-auto">
71-
<H1>Welcome to RetroUI</H1>
72-
73-
<div className="space-y-8 mt-12">
74-
...
75-
<div>
76-
<H3>New Component</H3>
77-
<NewComponent />
78-
</div>
79-
</div>
80-
</div>
59+
<span className="px-2.5 py-1 text-sm font-semibold border-2 border-red-600 text-red-600">
60+
Error
61+
</span>
8162
);
8263
}
8364
```
8465

66+
4. Add your component preview to the list of components registry in `config/components.ts`
67+
68+
```typescript
69+
export const componentConfig = {
70+
registry: {
71+
...
72+
"new-component": {
73+
name: "new-component",
74+
filePath: "preview/components/new-component.tsx",
75+
preview: lazy(() => import("@/preview/components/new-component")),
76+
},
77+
},
78+
};
79+
```
80+
81+
5. Add documentation for your component in `content/docs/components/...mdx`
82+
83+
```md
84+
---
85+
title: Badge
86+
description: The component that looks like a button but isn't clickable!
87+
lastUpdated: 08 Oct, 2024
88+
---
89+
90+
...
91+
92+
### New Component
93+
94+
<ComponentShowcase name="new-component" /> // name of the component in the registry
95+
```
8596

8697
## Ask for Help
87-
For any help or questions, please open a new GitHub issue.
98+
99+
For any help or questions, please open a new GitHub issue.

0 commit comments

Comments
 (0)