create-rose-uniapp
v1.0.5
Published
Create UniApp projects with Rose template - supports both direct and interactive creation
Maintainers
Readme
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
# Using pnpm (recommended)
pnpm create rose-uniapp my-project
# Using npm
npm create rose-uniapp my-project
# Using yarn
yarn create rose-uniapp my-projectMethod 2: Interactive Creation
# Using pnpm (recommended)
pnpm create rose-uniapp
# Using npm
npm create rose-uniapp
# Using yarn
yarn create rose-uniappThen 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:
🌐 Git Repository Download (Primary)
- Downloads latest code from
https://git.code.tencent.com/DefaultTemplate/uniapp.git - The entire
uniappproject is the template - Ensures users always get the newest features and fixes
- Uses shallow clone (
--depth 1) for faster downloads
- Downloads latest code from
🛡️ 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
# 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 buildTemplate 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
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 numberExamples
Create with specific template
pnpm create rose-uniapp my-app --template minimalForce overwrite existing directory
pnpm create rose-uniapp my-app --forceInteractive mode with all options
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 for details.
Development Setup
# 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 testLicense
MIT © rosesnsn
Links
Created with ❤️ by rosesnsn
