UNPKG

create-rose-uniapp

Version:

Create UniApp projects with Rose template - supports both direct and interactive creation

208 lines (152 loc) • 5.71 kB
# create-rose-uniapp 🌹 Create UniApp projects with Rose template - supports both direct and interactive creation ## Features - šŸš€ **Vue3 + TypeScript** - Modern development stack - šŸ“¦ **Pinia** - State management - 🌐 **Alova** - Network request library - šŸŽØ **uv-ui** - Component library - šŸ” **Authentication System** - Complete auth flow with route guards - šŸ“± **Multi-platform** - H5, WeChat Mini Program, APP - šŸ› ļø **Developer Experience** - Hot reload, TypeScript support - šŸŽÆ **Two Creation Modes** - Direct and interactive ## Quick Start ### Method 1: Direct Creation ```bash # Using pnpm (recommended) pnpm create rose-uniapp my-project # Using npm npm create rose-uniapp my-project # Using yarn yarn create rose-uniapp my-project ``` ### Method 2: Interactive Creation ```bash # Using pnpm (recommended) pnpm create rose-uniapp # Using npm npm create rose-uniapp # Using yarn yarn create rose-uniapp ``` Then follow the interactive prompts to configure your project. ## What's Included ### šŸ—ļø Project Structure ``` my-project/ ā”œā”€ā”€ src/ │ ā”œā”€ā”€ components/ # Reusable components │ ā”œā”€ā”€ pages/ # Page components │ ā”œā”€ā”€ store/ # Pinia stores │ ā”œā”€ā”€ utils/ # Utility functions │ ā”œā”€ā”€ router/ # Route configuration │ ā”œā”€ā”€ mixins/ # Global mixins │ └── types/ # TypeScript definitions ā”œā”€ā”€ docs/ # Documentation ā”œā”€ā”€ tailwindPlugin/ # Tailwind CSS plugins ā”œā”€ā”€ package.json └── ... ``` ### šŸŽØ Features - **šŸš€ Vue3 + TypeScript**: Modern development stack - **šŸ“¦ Pinia**: State management with persistence - **🌐 Alova**: Advanced HTTP client with caching - **šŸŽØ uv-ui + Element Plus**: Rich component libraries - **šŸ” Authentication System**: Complete auth flow with route guards - **šŸŽÆ Multi-platform**: H5, WeChat Mini Program, APP support - **šŸŽØ Tailwind CSS**: Utility-first CSS framework - **šŸ“± Responsive Design**: Mobile-first approach - **šŸ”§ Development Tools**: Hot reload, TypeScript, ESLint ### 🌟 Dynamic Template System This package uses a **true dynamic template system** with the following priority: 1. **🌐 Git Repository Download** (Primary) - Downloads latest code from `https://git.code.tencent.com/DefaultTemplate/uniapp.git` - The entire `uniapp` project is the template - Ensures users always get the newest features and fixes - Uses shallow clone (`--depth 1`) for faster downloads 2. **šŸ›”ļø Built-in Template** (Fallback) - Minimal UniApp project structure - Ensures the tool always works, even offline - Includes Vue3 + TypeScript + basic configuration **Key Benefits:** - āœ… **Always up-to-date** - No manual template synchronization needed - āœ… **Zero maintenance** - Templates update automatically - āœ… **Reliable fallbacks** - Works in any environment - āœ… **Development friendly** - Supports local development mode ### šŸ“± Development Commands ```bash # Install dependencies pnpm install # Development pnpm dev:h5 # H5 development pnpm dev:mp-weixin # WeChat Mini Program pnpm dev:app # APP development pnpm roseh # Rose mode development # Build pnpm build:h5 # H5 build pnpm build:mp-weixin # WeChat Mini Program build pnpm build:app # APP build ``` ## Template Options ### Default Template - Full-featured template with all components - Authentication system - Complete UI components - Network layer setup ### Minimal Template - Basic project structure - Essential dependencies only - Perfect for starting from scratch ## Requirements - **Node.js**: >= 14.0.0 - **pnpm**: >= 7.0.0 (recommended) ## CLI Options ```bash create-rose-uniapp [project-name] [options] Options: -f, --force Overwrite target directory if it exists -t, --template <type> Template variant (default: "default") -h, --help Display help for command -V, --version Display version number ``` ## Examples ### Create with specific template ```bash pnpm create rose-uniapp my-app --template minimal ``` ### Force overwrite existing directory ```bash pnpm create rose-uniapp my-app --force ``` ### Interactive mode with all options ```bash pnpm create rose-uniapp # Follow the prompts: # āœ” What is your project name? … my-awesome-app # āœ” Project description: … My awesome UniApp project # āœ” Author name: … Your Name # āœ” Choose a template variant: › Default (Vue3 + TypeScript + Full Features) ``` ## Contributing We welcome contributions! Please see our [Contributing Guide](https://git.code.tencent.com/DefaultTemplate/DefaultUniapp/blob/master/CONTRIBUTING.md) for details. ### Development Setup ```bash # Clone the create tool repository git clone https://git.code.tencent.com/DefaultTemplate/create-rose-uniapp.git cd create-rose-uniapp # Install dependencies pnpm install # Prepare the tool pnpm prepare # Test locally pnpm test ``` ## License MIT Ā© [rosesnsn](https://git.code.tencent.com/rosesnsn) ## Links - šŸ“¦ [NPM Package](https://www.npmjs.com/package/create-rose-uniapp) - šŸ™ [Create Tool Repository](https://git.code.tencent.com/DefaultTemplate/create-rose-uniapp) - šŸŽØ [Template Repository](https://git.code.tencent.com/DefaultTemplate/uniapp) - šŸ“š [Documentation](https://git.code.tencent.com/DefaultTemplate/create-rose-uniapp) - šŸ› [Issue Tracker](https://git.code.tencent.com/DefaultTemplate/create-rose-uniapp/issues) --- Created with ā¤ļø by [rosesnsn](https://git.code.tencent.com/rosesnsn)