116 lines
2.5 KiB
Markdown
116 lines
2.5 KiB
Markdown
|
|
# pnpm Setup Complete ✅
|
||
|
|
|
||
|
|
## Package Manager Migration
|
||
|
|
|
||
|
|
This project now uses **pnpm** as the default package manager instead of npm.
|
||
|
|
|
||
|
|
## ✅ Completed Steps
|
||
|
|
|
||
|
|
1. **Installed pnpm** (if not already installed)
|
||
|
|
2. **Removed npm artifacts** (node_modules, package-lock.json)
|
||
|
|
3. **Installed all dependencies** with pnpm
|
||
|
|
4. **Verified build process** works with pnpm
|
||
|
|
5. **Updated all documentation** to use pnpm commands
|
||
|
|
6. **Created .npmrc** for pnpm configuration
|
||
|
|
7. **Updated .gitignore** to exclude npm/yarn lock files (keeping pnpm-lock.yaml)
|
||
|
|
|
||
|
|
## 📦 Package Manager Commands
|
||
|
|
|
||
|
|
### Installation
|
||
|
|
```bash
|
||
|
|
# Install dependencies
|
||
|
|
pnpm install
|
||
|
|
|
||
|
|
# Add a dependency
|
||
|
|
pnpm add <package>
|
||
|
|
|
||
|
|
# Add a dev dependency
|
||
|
|
pnpm add -D <package>
|
||
|
|
|
||
|
|
# Remove a dependency
|
||
|
|
pnpm remove <package>
|
||
|
|
```
|
||
|
|
|
||
|
|
### Development
|
||
|
|
```bash
|
||
|
|
# Start dev server
|
||
|
|
pnpm run dev
|
||
|
|
|
||
|
|
# Build for production
|
||
|
|
pnpm run build
|
||
|
|
|
||
|
|
# Preview production build
|
||
|
|
pnpm run preview
|
||
|
|
|
||
|
|
# Run linter
|
||
|
|
pnpm run lint
|
||
|
|
```
|
||
|
|
|
||
|
|
### Testing
|
||
|
|
```bash
|
||
|
|
# Run tests
|
||
|
|
pnpm run test
|
||
|
|
|
||
|
|
# Run tests with UI
|
||
|
|
pnpm run test:ui
|
||
|
|
|
||
|
|
# Run tests with coverage
|
||
|
|
pnpm run test:coverage
|
||
|
|
|
||
|
|
# Run tests in watch mode
|
||
|
|
pnpm run test:watch
|
||
|
|
```
|
||
|
|
|
||
|
|
## 🔧 Configuration
|
||
|
|
|
||
|
|
### .npmrc
|
||
|
|
Created `.npmrc` with pnpm-specific settings:
|
||
|
|
- `auto-install-peers=true` - Automatically install peer dependencies
|
||
|
|
- `strict-peer-dependencies=false` - Relaxed peer dependency checking
|
||
|
|
|
||
|
|
### .gitignore
|
||
|
|
Updated to:
|
||
|
|
- Keep `pnpm-lock.yaml` (committed to repo)
|
||
|
|
- Ignore `package-lock.json` and `yarn.lock`
|
||
|
|
|
||
|
|
## 📊 Verification
|
||
|
|
|
||
|
|
✅ **Dependencies Installed**: All packages installed successfully
|
||
|
|
✅ **Build Successful**: Production build works correctly
|
||
|
|
✅ **Linter Works**: Code linting functions properly
|
||
|
|
✅ **Documentation Updated**: All docs reference pnpm
|
||
|
|
|
||
|
|
## 🚀 Quick Start
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# 1. Install dependencies
|
||
|
|
pnpm install
|
||
|
|
|
||
|
|
# 2. Set up environment variables
|
||
|
|
cp .env.example .env.local
|
||
|
|
# Edit .env.local with your values
|
||
|
|
|
||
|
|
# 3. Start development
|
||
|
|
pnpm run dev
|
||
|
|
```
|
||
|
|
|
||
|
|
## 📝 Notes
|
||
|
|
|
||
|
|
- **pnpm-lock.yaml**: This file is committed to version control to ensure consistent installs
|
||
|
|
- **Node Modules**: pnpm uses a content-addressable store, saving disk space
|
||
|
|
- **Speed**: pnpm is generally faster than npm for installs
|
||
|
|
- **Disk Efficiency**: pnpm uses hard links, reducing disk usage significantly
|
||
|
|
|
||
|
|
## 🔄 Migration from npm
|
||
|
|
|
||
|
|
If you were previously using npm:
|
||
|
|
|
||
|
|
1. Remove old lock file: `rm package-lock.json`
|
||
|
|
2. Install with pnpm: `pnpm install`
|
||
|
|
3. Use pnpm commands going forward
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Status**: ✅ **pnpm Setup Complete**
|
||
|
|
**Date**: 2025-01-22
|