neynarxyz / react

React SDK for Farcaster components - powered by Neynar APIs
https://neynar-react.vercel.app
MIT License
19 stars 14 forks source link

Reorganize folder structure for stories and shared components #1

Closed syntag closed 3 months ago

syntag commented 3 months ago

Reorganized folder directory to have a clear distinction between shared components and stories. Also, added a new Box shared component and added the missing .env.example file.

src/
├── components/
│   ├── stories/
│   │   ├── NeynarAuthButton/
│   │   └── index.ts
│   ├── shared/
│   │   ├── Box/
│   │   └── Modal/
Shreyaschorge commented 3 months ago

@syntag

Keeping all components within a /stories folder is not a typical practice. Generally, the /stories folder is reserved specifically for Storybook stories, which are used to develop and test components in isolation

The following structure has an index.tsx file, which will help us to pick and choose which components are allowed to be exposed from SDK. Thus preventing accidental exports or breaking imports.

├── components
│   ├── NeynarAuthButton
│   │   ├── icons
│   │   │   ├── FarcasterIcon.tsx
│   │   │   ├── PlanetBlackIcon.tsx
│   │   │   └── WarpcastIcon.tsx
│   │   └── index.tsx
│   ├── index.tsx
│   ├── shared
│   │   ├── Box
│   │   │   └── index.tsx
│   │   └── Toast
│   │       └── index.ts
│   └── stories
│       └── NeynarAuthButton.stories.tsx
syntag commented 3 months ago

@Shreyaschorge Thank you for the feedback. I couldn't find detailed guidance in the official documentation, aside from the brief mention of "Where to put stories." I made sure we followed that at the very least, but I'm open to reorganizing the files to align with best practices. Let's discuss async how we can improve the structure.

Shreyaschorge commented 3 months ago

@syntag

I have updated the structure like this for now