UNPKG

create-sparkvite

Version:

A blazing fast, opinionated CLI to scaffold React + Vite + Tailwind CSS v4 projects with modern tooling and zero configuration.

216 lines (159 loc) โ€ข 6.06 kB
# โšก create-sparkvite [![npm version](https://img.shields.io/npm/v/create-sparkvite?color=blue)](https://www.npmjs.com/package/create-sparkvite) [![License](https://img.shields.io/npm/l/create-sparkvite)](./LICENSE) [![Node.js Version](https://img.shields.io/node/v/create-sparkvite)](https://nodejs.org/) > ๐Ÿš€ A blazing fast, opinionated CLI to scaffold **React + Vite + Tailwind CSS v4** projects with modern tooling and zero configuration. SparkVite CLI creates production-ready React applications with carefully selected tools and configurations, so you can focus on building instead of setup. --- ## โœจ Features - โšก **Lightning Fast** โ€“ Powered by Vite for instant dev server and HMR - ๐ŸŽจ **Modern Styling** โ€“ Tailwind CSS v4 with latest features - ๐Ÿงฉ **Component Library** โ€“ Optional ShadCN UI integration - ๐Ÿ“ฆ **Package Manager Choice** โ€“ Support for npm, yarn, pnpm, and bun - ๐Ÿ”ค **TypeScript Ready** โ€“ Full TypeScript support out of the box - ๐Ÿง  **State Management** โ€“ Choose from Context API, Zustand, or Redux Toolkit - ๐Ÿงช **Testing Setup** โ€“ Vitest + Testing Library configuration - ๐Ÿ” **Code Quality** โ€“ ESLint + Prettier with sensible defaults - ๐Ÿ”— **Routing Ready** โ€“ React Router v6 integration - ๐Ÿ“ฑ **PWA Support** โ€“ Optional Progressive Web App configuration - ๐Ÿ—‚๏ธ **Smart Structure** โ€“ Organized folder structure with path aliases - ๐Ÿ“ก **Git Ready** โ€“ Automatic Git initialization with first commit --- ## ๐Ÿš€ Quick Start ```bash # Create a new SparkVite project npx create-sparkvite@latest # Follow the interactive prompts # Navigate to your project cd your-project-name # Start developing npm run dev ``` ## ๐Ÿ› ๏ธ Interactive Setup SparkVite CLI guides you through an interactive setup process: ### ๐Ÿ“ฆ **Project Configuration** - **Project Name** โ€“ Your app name (validates npm package naming) - **Package Manager** โ€“ Choose between npm, yarn, pnpm, or bun ### ๐ŸŽฏ **Technology Stack** - **Language** โ€“ JavaScript or TypeScript - **UI Library** โ€“ None or ShadCN UI - **State Management** โ€“ None, Context API, Zustand, or Redux Toolkit - **Routing** โ€“ Optional React Router integration - **PWA** โ€“ Progressive Web App support ### ๐Ÿ”ง **Development Tools** - **Testing** โ€“ Vitest + React Testing Library setup - **Code Quality** โ€“ ESLint + Prettier configuration - **Version Control** โ€“ Git repository initialization --- ## ๐Ÿ“ Project Structure SparkVite creates a well-organized project structure: ``` your-project/ โ”œโ”€ src/ โ”‚ โ”œโ”€ components/ โ”‚ โ”œโ”€ pages/ โ”‚ โ”œโ”€ layouts/ โ”‚ โ”œโ”€ hooks/ โ”‚ โ”œโ”€ utils/ โ”‚ โ”œโ”€ context/ โ”‚ โ”œโ”€ stores/ โ”‚ โ”œโ”€ App.tsx โ”‚ โ”œโ”€ main.tsx โ”‚ โ””โ”€ index.css โ”œโ”€ public/ โ”œโ”€ package.json โ”œโ”€ vite.config.ts โ”œโ”€ tailwind.config.js โ”œโ”€ tsconfig.json โ””โ”€ README.md ``` --- ## โš™๏ธ Configuration Details ### ๐ŸŽจ **Tailwind CSS v4** - Latest Tailwind CSS v4 with Vite plugin - Custom theme configuration ready - Optimized for production builds ### ๐Ÿ”— **Path Aliases** Pre-configured `@/` alias pointing to `src/`: ```typescript import Button from '@/components/Button'; import { useAuth } from '@/hooks/useAuth'; ``` ### ๐Ÿงช **Testing Setup** When enabled, includes: - Vitest test runner - React Testing Library - Jest DOM matchers - Sample test file ### ๐Ÿ” **Code Quality** ESLint + Prettier configuration with: - React and React Hooks rules - TypeScript support (when selected) - Prettier integration - Pre-configured scripts: `lint`, `lint:fix`, `format` ### ๐Ÿ“ฑ **PWA Configuration** Optional PWA setup with: - Vite PWA plugin - Service worker generation - Web app manifest --- ## ๐Ÿ“‹ Available Scripts After project creation, you can run: ```bash # Development npm run dev # Start development server npm run build # Build for production npm run preview # Preview production build # Code Quality (if enabled) npm run lint # Run ESLint npm run lint:fix # Fix ESLint issues npm run format # Format code with Prettier # Testing (if enabled) npm run test # Run tests with Vitest ``` --- ## ๐Ÿง  State Management Options ### **Context API** - Built-in React Context setup - App-level provider configuration - Custom hook for consuming context ### **Zustand** - Lightweight state management - TypeScript-ready store setup - Sample counter store included ### **Redux Toolkit** - Modern Redux with RTK - Pre-configured store setup - Sample slice with TypeScript support --- ## ๐Ÿ”ง Requirements - **Node.js** 18 or higher - **npm**, **yarn**, **pnpm**, or **bun** --- ### Development Setup ```bash git clone https://github.com/Abuhurera00/create-sparkvite cd create-sparkvite npm install npm run dev ``` --- ## ๐Ÿ› Issues & Support - ๐Ÿ› **Bug Reports**: [GitHub Issues](https://github.com/Abuhurera00/create-sparkvite/issues) - ๐Ÿ’ก **Feature Requests**: [GitHub Discussions](https://github.com/Abuhurera00/create-sparkvite/discussions) - ๐Ÿ“š **Documentation**: [Wiki](https://github.com/Abuhurera00/create-sparkvite/wiki) --- ## ๐Ÿ“„ License This project is licensed under the **MIT License** - see the [LICENSE](./LICENSE) file for details. --- ## ๐Ÿ™ Acknowledgments SparkVite CLI is built on top of these amazing projects: - [Vite](https://vitejs.dev/) - Next generation frontend tooling - [React](https://react.dev/) - A JavaScript library for building user interfaces - [Tailwind CSS](https://tailwindcss.com/) - A utility-first CSS framework - [ShadCN UI](https://ui.shadcn.com/) - Beautifully designed components --- <div align="center"> **Made with โค๏ธ for the React community** [โญ Star on GitHub](https://github.com/Abuhurera00/create-sparkvite) โ€ข [๐Ÿ“ฆ View on NPM](https://www.npmjs.com/package/create-sparkvite) </div>