Contribution

Contribute to shuip to make it better.

Configuration

Installation

  1. Clone the repository

    git clone https://github.com/plvo/shuip.git
    cd shuip
  2. Install dependencies

    bun install
  3. Create a branch for your changes

    git checkout -b feat/my-component
  4. Start the development server

    bun run dev

Add a component

File structure

Each shuip component follows this structure:

โ”œโ”€โ”€ registry/
โ”‚ โ”œโ”€โ”€ ui/
โ”‚ โ”‚ โ””โ”€โ”€ my-component.tsx # Implementation of the component
โ”‚ โ””โ”€โ”€ examples/
โ”‚ โ””โ”€โ”€ my-component.tsx # Base example
โ”‚ โ””โ”€โ”€ my-component.with-state.tsx # Example with the title "With state"
โ”‚ โ””โ”€โ”€ my-component.disabled.tsx # Example with the title "Disabled"
โ”œโ”€โ”€ docs/components/
โ”‚ โ””โ”€โ”€ my-component.mdx # Documentation of the component
โ””โ”€โ”€ registry.json # Registry configuration

Detailed steps

  1. Create your component in registry/ui/
  2. Create at least one example in registry/examples/ (with the same name as the component file)
  3. Generate and build the registry files
    bun run registry:generate # Generates the registry/__index__.tsx file
    bun run registry:build # Generates the JSONs in public/r/*
  4. Create the component documentation in content/components/
    ---
    title: My Component
    description: Description of the component
    group: shortcut
    ---
    <ItemHeader filename={'my-component'} />
    # ...
    <ItemFooter itemName={'my-component'} props={[
    {
    name: 'label',
    type: 'string',
    description: 'The label of the component',
    },
    ]} />

Submit your contribution

Create a Pull Request

git add .
git commit -m "feat: new component my-component"
git push origin feat/my-component

Thank you for your contribution to shuip! ๐Ÿš€