npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

shared-cli

v1.0.11

Published

Powerful CLI tool for generating SolidJS shared components with atomic design principles, TypeScript support, and Tailwind CSS styling. Perfect for VS Code extensions and modern web development.

Readme

@shared-cli

npm version License: MIT

Powerful CLI tool for generating SolidJS components with atomic design principles, TypeScript support, and Tailwind CSS styling.

🚀 Features

  • Atomic Design: Built with atomic design principles (atoms, molecules, organisms, templates, pages)
  • TypeScript First: Full TypeScript support with proper type definitions
  • Tailwind CSS: Pre-configured Tailwind CSS classes for consistent styling
  • Family Support: Component families for related components (e.g., Breadcrumb family)
  • SolidJS Optimized: Specifically designed for SolidJS patterns and best practices
  • Customizable: Easy to extend with new components and variants
  • Storybook Ready: Generated components work seamlessly with Storybook

📦 Installation

Global Installation

npm install -g @shared-cli

Project Installation

npm install @shared-cli --save-dev

🎯 Quick Start

Generate a Single Component

shared-cli generate Button

Generate All Components

shared-cli generate-all

List Available Components

shared-cli list

Custom Target Directory

shared-cli generate Button --dir src/components

🧩 Available Components

Atoms

  • Alert: Notification messages with variants (info, success, error)
  • Avatar: User profile images with fallback
  • Badge: Status indicators and labels
  • Button: Interactive buttons with multiple variants
  • Spinner: Loading indicators with size and color options

Families

  • Breadcrumb: Navigation breadcrumb system with:
    • Breadcrumb: Container component
    • BreadcrumbList: List wrapper
    • BreadcrumbItem: Individual item
    • BreadcrumbLink: Clickable links
    • BreadcrumbPage: Current page
    • BreadcrumbSeparator: Visual separators
    • `BreadcrumbEllipsis**: Collapsed state indicator

📚 Usage Examples

Basic Button

import { Button } from './components/atoms/Button';

<Button variant="primary" size="md" onClick={() => console.log('clicked')}>
  Click me
</Button>

Alert Component

import { Alert } from './components/atoms/Alert';

<Alert variant="success">
  Operation completed successfully!
</Alert>

Spinner Component

import { Spinner } from './components/atoms/Spinner';

<Spinner size="lg" color="primary" />

Breadcrumb Navigation

import {
  Breadcrumb,
  BreadcrumbList,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbPage,
  BreadcrumbSeparator
} from './components/molecules/breadcrumb';

<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink href="/products">Products</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Details</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

🎨 Component Variants

Button Variants

// Solid variants
<Button variant="primary" />
<Button variant="secondary" />
<Button variant="success" />
<Button variant="danger" />

// Outline variants
<Button variant="outline" />
<Button variant="ghost" />

Size Options

// Available for: Button, Avatar, Spinner
<Component size="sm" />  // Small
<Component size="md" />  // Medium (default)
<Component size="lg" />  // Large

🔧 Configuration

Adding New Components

  1. Update components.json:
{
  "name": "MyComponent",
  "props": ["size", "variant", "className"],
  "defaultClass": "base-component-class",
  "type": "atom"
}
  1. Add JSX Template in bin/index.js:
case 'MyComponent':
  return `// Your component template here`;
  1. Generate:
shared-cli generate MyComponent

Custom Component Families

For complex components like Breadcrumb, create families:

{
  "name": "Breadcrumb",
  "props": ["className"],
  "defaultClass": "",
  "type": "molecule",
  "family": "breadcrumb"
}

🎯 Project Structure

src/components/
├── atoms/           # UI building blocks
│   ├── Alert.tsx
│   ├── Avatar.tsx
│   ├── Badge.tsx
│   ├── Button.tsx
│   └── Spinner.tsx
├── molecules/       # Combinations of atoms
│   └── breadcrumb/
│       ├── Breadcrumb.tsx
│       ├── BreadcrumbList.tsx
│       ├── BreadcrumbItem.tsx
│       └── ...
├── organisms/       # Complex UI sections
├── templates/       # Page layouts
├── pages/          # Complete pages
└── index.ts        # Main exports

📖 API Reference

CLI Commands

  • generate <component>: Generate a specific component
  • generate-all: Generate all available components
  • list: List all available components

Options

  • -d, --dir <directory>: Target directory (default: src/components)

Props Interface

Each component exports a TypeScript interface:

export interface ButtonProps {
  variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'outline' | 'ghost';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
  className?: string;
  onClick?: () => void;
  children: JSX.Element;
}

🔄 Integration with Storybook

Generated components work out-of-the-box with Storybook:

  1. Generate components
  2. Import in your stories:
import { Button } from '../components/atoms/Button';

// ... Storybook configuration

🛠️ Development

Local Development

# Clone repository
git clone https://github.com/your-username/solid-cli.git

# Install dependencies
cd solid-cli/packages/shared-cli
npm install

# Test CLI
npm run generate Button

Building

npm run build

Testing

npm test
npm run publish:dry  # Test package without publishing

📝 Requirements

  • Node.js >= 16.0.0
  • SolidJS project
  • TypeScript (recommended)
  • Tailwind CSS (for styling)

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Support

🔗 Related Projects


Happy coding with @shared-cli! 🎉