Skip to content

Commit f0ddb6a

Browse files
committed
chore: wip
1 parent e7a2d81 commit f0ddb6a

24 files changed

+111
-2934
lines changed

docs/api/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ interface LaunchpadConfig {
267267
showShellMessages: boolean
268268
/** Custom message to show when environment is activated (default: "✅ Environment activated for {path}") */
269269
shellActivationMessage: string
270-
/** Custom message to show when environment is deactivated (default: "dev environment deactivated") */
270+
/** Custom message to show when environment is deactivated (default: "Environment deactivated") */
271271
shellDeactivationMessage: string
272272
}
273273

docs/config.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ const config: LaunchpadConfig = {
6363
// Use {path} placeholder to include the project path (default: "✅ Environment activated for {path}")
6464
shellActivationMessage: '✅ Environment activated for {path}',
6565

66-
// Custom message to show when environment is deactivated (default: "dev environment deactivated")
67-
shellDeactivationMessage: 'dev environment deactivated',
66+
// Custom message to show when environment is deactivated (default: "Environment deactivated")
67+
shellDeactivationMessage: 'Environment deactivated',
6868

6969
// Service Management Configuration
7070
services: {
@@ -124,7 +124,7 @@ JavaScript format (`.launchpadrc`):
124124
"autoAddToPath": true,
125125
"showShellMessages": true,
126126
"shellActivationMessage": "✅ Environment activated for {path}",
127-
"shellDeactivationMessage": "dev environment deactivated",
127+
"shellDeactivationMessage": "Environment deactivated",
128128
"services": {
129129
"enabled": true,
130130
"dataDir": "~/.local/share/launchpad/services",
@@ -206,19 +206,22 @@ Services use these configurable template variables:
206206
### Examples
207207

208208
#### Development Setup (Default)
209+
209210
```bash
210211
# Uses: username=root, password=password, authMethod=trust
211212
launchpad start postgres
212213
```
213214

214215
#### Custom Development Setup
216+
215217
```bash
216218
export LAUNCHPAD_DB_USERNAME="dev_user"
217219
export LAUNCHPAD_DB_PASSWORD="dev_password"
218220
launchpad start postgres
219221
```
220222

221223
#### Production-like Setup
224+
222225
```bash
223226
export LAUNCHPAD_DB_AUTH_METHOD="md5"
224227
export LAUNCHPAD_DB_PASSWORD="secure_password123"
@@ -323,9 +326,11 @@ launchpad clean --keep-global --dry-run
323326
```
324327

325328
**Global dependency detection**:
329+
326330
- Any dependency file (`deps.yaml`, `dependencies.yaml`, etc.) with `global: true`
327331

328332
**Example global dependency file** (`~/.dotfiles/deps.yaml`):
333+
329334
```yaml
330335
global: true
331336
dependencies:
@@ -360,6 +365,7 @@ services:
360365
```
361366

362367
Behavior:
368+
363369
- **enabled**: toggles service management for the project.
364370
- **autoStart**: array of service names to start automatically on environment activation.
365371
- Service names must match those in the Supported Services list (e.g. `postgres`, `redis`, `nginx`).
@@ -380,12 +386,14 @@ services:
380386
```
381387

382388
When enabled and a Laravel app is detected (`artisan` present), Launchpad will read `.env` and infer services:
389+
383390
- `DB_CONNECTION=pgsql` → `postgres`
384391
- `DB_CONNECTION=mysql|mariadb` → `mysql`
385392
- `CACHE_DRIVER=redis` or `CACHE_STORE=redis` → `redis`
386393
- `CACHE_DRIVER=memcached` or `CACHE_STORE=memcached` → `memcached`
387394

388395
Environment toggles:
396+
389397
- `LAUNCHPAD_FRAMEWORKS_ENABLED` (default: true)
390398
- `LAUNCHPAD_SERVICES_INFER` (default: true)
391399
- `LAUNCHPAD_LARAVEL_ENABLED` (default: true)
@@ -424,7 +432,7 @@ Environment toggles:
424432
|--------|------|---------|-------------|
425433
| `showShellMessages` | boolean | `true` | Whether to display environment activation/deactivation messages |
426434
| `shellActivationMessage` | string | `"✅ Environment activated for {path}"` | Custom message shown when environment is activated. Use `{path}` placeholder for project path |
427-
| `shellDeactivationMessage` | string | `"dev environment deactivated"` | Custom message shown when environment is deactivated |
435+
| `shellDeactivationMessage` | string | `"Environment deactivated"` | Custom message shown when environment is deactivated |
428436

429437
### Path Management
430438

@@ -538,6 +546,7 @@ postActivation:
538546
```
539547

540548
Notes:
549+
541550
- Inline hooks in `deps.yaml` run alongside config hooks of the same phase.
542551
- preSetup runs before dependency installation and service auto-start.
543552
- preActivation runs after installation/services and before printing the activation message.
@@ -583,7 +592,9 @@ When you cd into a project directory that contains a dependency file (e.g. `deps
583592
The target environment directory is derived as:
584593

585594
```
595+
586596
~/.local/share/launchpad/envs/<project>_<hash>-d<dep_hash>
597+
587598
```
588599

589600
This guarantees that editing dependency versions switches to a distinct environment on the next `cd`, ensuring the correct tools are active immediately.
@@ -751,6 +762,7 @@ launchpad --verbose install --dry-run node
751762
### Configuration Not Loading
752763

753764
1. Check file syntax:
765+
754766
```bash
755767
# For TypeScript files
756768
bunx tsc --noEmit launchpad.config.ts
@@ -760,6 +772,7 @@ launchpad --verbose install --dry-run node
760772
```
761773

762774
2. Verify file location:
775+
763776
```bash
764777
# Check current directory
765778
ls -la launchpad.config.*
@@ -769,18 +782,21 @@ launchpad --verbose install --dry-run node
769782
```
770783

771784
3. Test with verbose mode:
785+
772786
```bash
773787
launchpad --verbose list
774788
```
775789

776790
### Environment Variables Not Working
777791

778792
1. Check if variables are set:
793+
779794
```bash
780795
env | grep LAUNCHPAD
781796
```
782797

783798
2. Export variables properly:
799+
784800
```bash
785801
export LAUNCHPAD_VERBOSE=true
786802
export LAUNCHPAD_INSTALL_PATH=/custom/path
@@ -790,6 +806,7 @@ launchpad --verbose install --dry-run node
790806
```
791807

792808
3. Verify shell configuration:
809+
793810
```bash
794811
echo $SHELL
795812
source ~/.zshrc # or ~/.bashrc

docs/features/environment-management.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ Launchpad uses a human-readable hash format for environment directories:
3232
**Format:** `{project-name}_{8-char-hex-hash}-d{8-char-dep-hash}`
3333

3434
**Examples:**
35+
3536
- `my-web-app_1a2b3c4d-d9f1a2b3` - Project `/home/user/projects/my-web-app`, dependency fingerprint `d9f1a2b3`
3637
- `api-server_5e6f7g8h-d0c1e2f3` - Project `/work/api-server`, dependency fingerprint `d0c1e2f3`
3738

3839
**Benefits:**
40+
3941
- **Human-readable** - Easy to identify which project an environment belongs to
4042
- **Version-aware** - Dependency changes always map to a distinct environment
4143
- **Unique** - 8-character hex hash prevents collisions between projects
@@ -53,10 +55,12 @@ Launchpad automatically detects these dependency files:
5355
- `.deps.yml` / `.deps.yaml`
5456

5557
For pkgx compatibility, Launchpad also supports:
58+
5659
- `pkgx.yaml` / `pkgx.yml`
5760
- `.pkgx.yaml` / `.pkgx.yml`
5861

5962
**Example dependency file:**
63+
6064
```yaml
6165
dependencies:
6266
- node@22
@@ -74,6 +78,7 @@ env:
7478
Control where packages are installed using the `global` flag:
7579

7680
**Individual Package Control:**
81+
7782
```yaml
7883
# dependencies.yaml
7984
dependencies:
@@ -98,6 +103,7 @@ env:
98103
```
99104

100105
**Top-Level Global Flag:**
106+
101107
```yaml
102108
# dependencies.yaml
103109
global: true # Install all packages globally by default
@@ -116,6 +122,7 @@ env:
116122
```
117123

118124
**Global Installation Behavior:**
125+
119126
- **Global packages** (`global: true`): Installed system-wide, available in all environments
120127
- **Local packages** (`global: false` or default): Installed per-project, isolated from other environments
121128
- **Mixed approach**: Combine global tools with project-specific dependencies
@@ -137,7 +144,7 @@ Once set up, environments automatically activate:
137144

138145
```bash
139146
cd my-project/ # → ✅ Environment activated for /path/to/my-project
140-
cd ../ # → dev environment deactivated
147+
cd ../ # → Environment deactivated
141148
```
142149

143150
### Customizing Shell Messages
@@ -219,6 +226,7 @@ launchpad env:ls --format simple
219226
**Output formats:**
220227

221228
**Table (default):**
229+
222230
```
223231
📦 Development Environments:
224232

@@ -233,6 +241,7 @@ Total: 3 environment(s)
233241
```
234242
235243
**JSON:**
244+
236245
```json
237246
[
238247
{
@@ -247,6 +256,7 @@ Total: 3 environment(s)
247256
```
248257

249258
**Simple:**
259+
250260
```
251261
final-project (final-project_7db6cf06)
252262
working-test (working-test_208a31ec)
@@ -269,6 +279,7 @@ launchpad env:inspect dummy_6d7cf1d6 --show-stubs
269279
```
270280

271281
**Example output:**
282+
272283
```
273284
🔍 Inspecting environment: working-test_208a31ec
274285
@@ -306,6 +317,7 @@ Overall Status: ✅ Healthy
306317
```
307318

308319
**Health Check Criteria:**
320+
309321
- **Binaries present** - Environment has executable binaries
310322
- **Packages installed** - Package directories exist and contain files
311323
- **Directory structure** - Required directories (bin, pkgs) exist
@@ -332,6 +344,7 @@ launchpad env:clean --verbose
332344
```
333345

334346
**Cleanup Criteria:**
347+
335348
- Environments with no binaries (failed installations)
336349
- Environments older than specified days (default: 30)
337350
- Empty or corrupted environment directories
@@ -380,6 +393,7 @@ fi
380393
Environments work seamlessly with development tools:
381394

382395
**Node.js project example:**
396+
383397
```yaml
384398
dependencies:
385399
- node@22
@@ -392,6 +406,7 @@ env:
392406
```
393407
394408
**Python project example:**
409+
395410
```yaml
396411
dependencies:
397412
@@ -408,50 +423,59 @@ env:
408423
#### Environment Not Activating
409424
410425
1. Check shell integration:
426+
411427
```bash
412428
type _pkgx_chpwd_hook
413429
```
414430

415431
2. Verify dependency file:
432+
416433
```bash
417434
launchpad dev:dump --dryrun
418435
```
419436

420437
3. Check file detection:
438+
421439
```bash
422440
ls -la dependencies.yaml
423441
```
424442

425443
#### Environment Messages Not Showing
426444

427445
1. Check message settings:
446+
428447
```bash
429448
echo $LAUNCHPAD_SHOW_ENV_MESSAGES
430449
```
431450

432451
2. Verify shell integration:
452+
433453
```bash
434454
grep "launchpad dev:shellcode" ~/.zshrc
435455
```
436456

437457
3. Test manual activation:
458+
438459
```bash
439460
eval "$(launchpad dev:shellcode)"
440461
```
441462

442463
#### Performance Issues
443464

444465
1. Clean old environments:
466+
445467
```bash
446468
launchpad env:clean --older-than 7
447469
```
448470

449471
2. Check disk usage:
472+
450473
```bash
451474
du -sh ~/.local/share/launchpad/envs/*
452475
```
453476

454477
3. Monitor activation time:
478+
455479
```bash
456480
time (cd my-project && cd ..)
457481
```
@@ -479,16 +503,19 @@ env:
479503
### Troubleshooting
480504

481505
**Environment not activating:**
506+
482507
1. Check shell integration: `echo 'eval "$(launchpad dev:shellcode)"' >> ~/.zshrc`
483508
2. Verify dependency file exists and has correct syntax
484509
3. Reload shell configuration: `source ~/.zshrc`
485510

486511
**Package installation failures:**
512+
487513
1. Check internet connectivity
488514
2. Verify package names and versions exist in pkgx
489515
3. Use `launchpad dev:dump --verbose` for detailed error information
490516

491517
**Hash collisions (rare):**
518+
492519
1. Different projects with same name get different hashes based on full path
493520
2. If collision occurs, rename one of the project directories
494521
3. Remove old environment: `launchpad env:remove {hash}`

0 commit comments

Comments
 (0)