create-rose-uniapp
Version:
Create UniApp projects with Rose template - supports both direct and interactive creation
208 lines (152 loc) ⢠5.71 kB
Markdown
# 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)