vitesse-dependency-scripts
Version:
Automated toolkit for managing dependencies with pnpm catalogs in Vue/Vite projects
337 lines (256 loc) β’ 9.45 kB
Markdown
# Which Script Should I Use? π€
Quick guide to help you choose the right script for your needs.
## π― Quick Decision Tree
```
βββββββββββββββββββββββββββββββββββββββ
β What do you need to do? β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββ΄βββββββββ
β β
NEW PROJECT UPDATE EXISTING
β β
βΌ βΌ
β βββββββββββββββββββ
β β auto-update- β
β β full.js β
β β β
β β Updates deps in β
β β current project β
β βββββββββββββββββββ
β
βββββββ΄βββββββ
β β
β Do you needβ
β LATEST β
β versions? β
β β
βββββββ¬βββββββ
β
βββββ΄ββββ
YES NO
β β
βΌ βΌ
ββββββββββββββββ ββββββββββββββββββ
β β create- β β create- β
β project- β β vitesse- β
β instant.js β β project.js β
β β β β
β RECOMMENDED! β β Basic setup β
ββββββββββββββββ ββββββββββββββββββ
```
## π Feature Comparison
| Feature | create-project-instant.js β‘ | create-vitesse-project.js | auto-update-full.js |
|---------|------------------------------|---------------------------|---------------------|
| **Creates new project** | β
| β
| β |
| **Updates existing project** | β | β | β
|
| **Fetches latest npm versions** | β
Real-time | β
| β
Real-time |
| **Enhanced console output** | β YES | Basic | Basic |
| **Shows progress in real-time** | β YES | Basic | β οΈ Limited |
| **Displays timing** | β YES | β | β |
| **Better error handling** | β YES | Basic | Basic |
| **Skip detection** | β Detailed | Basic | Basic |
| **Creates backups** | β (new project) | β (new project) | β
|
| **Best for** | β New projects | Basic new projects | Existing projects |
## π The Three Scripts Explained
### 1. β‘ create-project-instant.js (RECOMMENDED for new projects)
**What it does:**
- Creates a new Vitesse project from scratch
- Fetches the LATEST version of every package in real-time
- Updates workspace catalogs with latest versions
- Updates package.json with catalog references
- Installs all dependencies
- Shows beautiful, detailed progress
**When to use:**
- β
Starting a brand new project
- β
You want the absolute latest versions
- β
You want a polished user experience
- β
You want to see detailed progress
**Command:**
```bash
node create-project-instant.js my-awesome-app
```
**Example output:**
```
π Creating new Vitesse project: my-awesome-app
π₯ Cloning Vitesse template...
β
Project created at ./my-awesome-app
π Updating pnpm-workspace.yaml with latest versions...
π¦ Processing 'frontend' catalog (20 packages)...
π Fetching @casl/ability... ^6.7.1
β
@casl/ability: ^6.7.1
...
β±οΈ Total time: 52.1s
π PROJECT READY!
```
### 2. π¦ create-vitesse-project.js (Basic)
**What it does:**
- Creates a new Vitesse project from scratch
- Fetches latest versions and adds dependencies
- Updates workspace and package.json
- Installs dependencies
- Simpler, more basic output
**When to use:**
- β
Starting a new project
- β
You're okay with basic console output
- β
You don't need detailed progress
**Command:**
```bash
node create-vitesse-project.js my-app
```
**Difference from instant:**
- Less detailed console output
- No timing information
- No enhanced progress indicators
- Same functionality, simpler presentation
### 3. π auto-update-full.js (For existing projects)
**What it does:**
- Updates an EXISTING project
- Fetches latest versions from npm
- Updates pnpm-workspace.yaml
- Updates package.json with catalog references
- Runs pnpm install
- Creates backups before modifying
**When to use:**
- β
You already have a project
- β
You want to update to latest versions
- β
You want to add new dependencies
- β
You need backups of your files
**Command:**
```bash
node auto-update-full.js
```
**Important:** Run this FROM your project directory or the dependency-scripts folder.
## π‘ Common Scenarios
### Scenario 1: "I'm starting a brand new project"
**Use:** `create-project-instant.js` β‘
```bash
cd dependency-scripts
node create-project-instant.js my-new-project
cd ../my-new-project
pnpm dev
```
**Why?** You get the best experience with latest versions and detailed progress.
### Scenario 2: "I'm starting a new project but I don't care about fancy output"
**Use:** `create-vitesse-project.js`
```bash
cd dependency-scripts
node create-vitesse-project.js my-project
cd ../my-project
pnpm dev
```
**Why?** Simpler output, same result.
### Scenario 3: "I have an existing project and want to update dependencies"
**Use:** `auto-update-full.js`
```bash
cd dependency-scripts
node auto-update-full.js
```
**Why?** This is designed specifically for updating existing projects.
### Scenario 4: "I have an existing project and want to add NEW dependencies"
**Use:** `auto-update-full.js`
1. First, add the packages to the `DEPENDENCIES` object in the script
2. Then run:
```bash
cd dependency-scripts
node auto-update-full.js
```
### Scenario 5: "I just want to test packages without the catalog system"
**Use:** `install-missing-deps.sh`
```bash
cd dependency-scripts
./install-missing-deps.sh
```
**Why?** Direct install, no catalog configuration.
## π¨ Visual Comparison
### create-project-instant.js β‘
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β ποΈ Vitesse Instant Project Creator β
βββββββββββββββββββββββββββββββββββββββββββββββ
π Creating new Vitesse project...
π Updating pnpm-workspace.yaml...
π¦ Processing 'frontend' catalog (20 packages)...
π Fetching @casl/ability... ^6.7.1
β
@casl/ability: ^6.7.1
...
β±οΈ Total time: 52.1s
βββββββββββββββββββββββββββββββββββββββββββββββ
π PROJECT READY! π
βββββββββββββββββββββββββββββββββββββββββββββββ
```
### create-vitesse-project.js
```
π Creating new Vitesse project: my-app
π₯ Cloning Vitesse template...
β
Project created at ./my-app
π Updating pnpm-workspace.yaml...
β
Workspace file updated!
π Updating package.json...
β
Added 33 catalog references
π¦ Installing dependencies...
β
Dependencies installed successfully!
π Project setup complete!
```
### auto-update-full.js
```
π Complete Auto Update - Workspace & Package.json
π¦ Backups created:
- pnpm-workspace.yaml.backup.1697123456789
- package.json.backup.1697123456789
ββββββββββββββββββββββββββββββββββββββββ
π₯ Processing 'frontend' catalog...
π Fetching @casl/ability...
β
Adding to workspace: @casl/ability: ^6.7.1
...
β¨ Files updated successfully!
π¦ Installing dependencies with pnpm...
β
All done!
```
## π Recommendations
### For Most Users
**Use `create-project-instant.js`** when creating new projects.
It provides:
- β
Best user experience
- β
Detailed progress
- β
Latest versions
- β
Clear feedback
- β
Timing information
### For Advanced Users
If you prefer simplicity and don't need fancy output, use `create-vitesse-project.js`.
### For Existing Projects
Always use `auto-update-full.js` - it's the only one designed for updates.
## π Summary
| I want to... | Use this script |
|--------------|-----------------|
| Create a new project with best experience | `create-project-instant.js` β |
| Create a new project (basic) | `create-vitesse-project.js` |
| Update an existing project | `auto-update-full.js` |
| Add new deps to existing project | `auto-update-full.js` |
| Test packages without catalogs | `install-missing-deps.sh` |
| Only update workspace file | `auto-update-catalog.js` |
## π Learn More
- [INSTANT-CREATE-README.md](./INSTANT-CREATE-README.md) - Detailed guide for create-project-instant.js
- [CREATE-PROJECT-README.md](./CREATE-PROJECT-README.md) - Guide for create-vitesse-project.js
- [AUTO-UPDATE-README.md](./AUTO-UPDATE-README.md) - Guide for auto-update-full.js
- [README.md](./README.md) - Main documentation
## π¬ Still Confused?
**Rule of thumb:**
- **New project?** β `create-project-instant.js` β‘
- **Existing project?** β `auto-update-full.js`
That's it! π