- Added .cursor/sessions/* to .gitignore to prevent session files from being tracked. - Enhanced coding standards in SKILL.md by adding semicolons to TypeScript examples for consistency. - Improved formatting in continuous learning, detail layout, and other SKILL.md files for better readability. These changes aim to streamline development processes and maintain code quality across the project.
84 lines
1.6 KiB
Markdown
84 lines
1.6 KiB
Markdown
---
|
|
description: Configure your preferred package manager (npm/pnpm/yarn/bun)
|
|
disable-model-invocation: true
|
|
---
|
|
|
|
# Package Manager Setup
|
|
|
|
Configure your preferred package manager for this project or globally.
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
# Detect current package manager
|
|
node scripts/setup-package-manager.js --detect
|
|
|
|
# Set global preference
|
|
node scripts/setup-package-manager.js --global pnpm
|
|
|
|
# Set project preference
|
|
node scripts/setup-package-manager.js --project bun
|
|
|
|
# List available package managers
|
|
node scripts/setup-package-manager.js --list
|
|
```
|
|
|
|
## Detection Priority
|
|
|
|
When determining which package manager to use, the following order is checked:
|
|
|
|
1. **Environment variable**: `CURSOR_PACKAGE_MANAGER`
|
|
2. **Project config**: `.cursor/package-manager.json`
|
|
3. **package.json**: `packageManager` field
|
|
4. **Lock file**: Presence of package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb
|
|
5. **Global config**: `~/.cursor/package-manager.json`
|
|
6. **Fallback**: First available package manager (pnpm > bun > yarn > npm)
|
|
|
|
## Configuration Files
|
|
|
|
### Global Configuration
|
|
|
|
```json
|
|
// ~/.cursor/package-manager.json
|
|
{
|
|
"packageManager": "pnpm"
|
|
}
|
|
```
|
|
|
|
### Project Configuration
|
|
|
|
```json
|
|
// .cursor/package-manager.json
|
|
{
|
|
"packageManager": "bun"
|
|
}
|
|
```
|
|
|
|
### package.json
|
|
|
|
```json
|
|
{
|
|
"packageManager": "pnpm@8.6.0"
|
|
}
|
|
```
|
|
|
|
## Environment Variable
|
|
|
|
Set `CURSOR_PACKAGE_MANAGER` to override all other detection methods:
|
|
|
|
```bash
|
|
# Windows (PowerShell)
|
|
$env:CURSOR_PACKAGE_MANAGER = "pnpm"
|
|
|
|
# macOS/Linux
|
|
export CURSOR_PACKAGE_MANAGER=pnpm
|
|
```
|
|
|
|
## Run the Detection
|
|
|
|
To see current package manager detection results, run:
|
|
|
|
```bash
|
|
node scripts/setup-package-manager.js --detect
|
|
```
|