@@ -15,6 +15,23 @@ const isMacOS = platform() === 'darwin'
15
15
const isLinux = platform () === ' linux'
16
16
```
17
17
18
+ ## Installation Philosophy Across Platforms
19
+
20
+ Launchpad follows the ** pkgm approach** consistently across all platforms:
21
+
22
+ ### Unix-like Systems (macOS, Linux)
23
+ - ** Primary** : ` /usr/local ` for system-wide installations
24
+ - ** Fallback** : ` ~/.local ` for user-specific installations
25
+ - ** Never uses** : ` /opt/homebrew ` (Homebrew's directory)
26
+ - ** Maintains** : Clean separation from package managers like Homebrew
27
+
28
+ ### Windows
29
+ - ** Primary** : ` %LOCALAPPDATA% ` for user-specific installations
30
+ - ** Alternative** : ` %PROGRAMFILES% ` for system-wide (requires elevation)
31
+ - ** Avoids** : Conflicting with Windows package managers
32
+
33
+ This consistent approach ensures clean coexistence with existing package managers on all platforms.
34
+
18
35
## Path Handling
19
36
20
37
### Windows Path Differences
@@ -48,6 +65,22 @@ Each platform uses different shells by default:
48
65
49
66
Launchpad adapts its PATH modification strategies accordingly.
50
67
68
+ ### Shell Message Customization by Platform
69
+
70
+ You can customize shell messages differently on each platform:
71
+
72
+ ``` bash
73
+ # macOS/Linux - Using ~/.zshrc or ~/.bashrc
74
+ export LAUNCHPAD_SHELL_ACTIVATION_MESSAGE=" 🍎 macOS environment ready: {path}"
75
+ export LAUNCHPAD_SHELL_DEACTIVATION_MESSAGE=" 🍎 macOS environment closed"
76
+ ```
77
+
78
+ ``` powershell
79
+ # Windows - Using PowerShell profile
80
+ $env:LAUNCHPAD_SHELL_ACTIVATION_MESSAGE = "🪟 Windows environment ready: {path}"
81
+ $env:LAUNCHPAD_SHELL_DEACTIVATION_MESSAGE = "🪟 Windows environment closed"
82
+ ```
83
+
51
84
## File System Permissions
52
85
53
86
Permission handling differs by platform:
@@ -82,6 +115,9 @@ Launchpad's auto-sudo feature automatically adapts to the platform.
82
115
# Add to PATH on Unix-like systems
83
116
echo ' export PATH="~/.local/bin:$PATH"' >> ~ /.zshrc
84
117
source ~ /.zshrc
118
+
119
+ # Custom shell messages
120
+ echo ' export LAUNCHPAD_SHELL_ACTIVATION_MESSAGE="🔧 Dev environment: {path}"' >> ~ /.zshrc
85
121
```
86
122
87
123
### Windows (PowerShell)
@@ -91,6 +127,9 @@ source ~/.zshrc
91
127
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User")
92
128
$newPath = "$env:USERPROFILE\.local\bin;" + $currentPath
93
129
[Environment]::SetEnvironmentVariable("PATH", $newPath, "User")
130
+
131
+ # Custom shell messages
132
+ [Environment]::SetEnvironmentVariable("LAUNCHPAD_SHELL_ACTIVATION_MESSAGE", "🔧 Dev environment: {path}", "User")
94
133
```
95
134
96
135
## Executable Detection
@@ -104,11 +143,24 @@ Launchpad handles these differences when creating and detecting executables.
104
143
105
144
## Platform-specific Installation Paths
106
145
107
- Default installation paths vary by platform:
146
+ Default installation paths vary by platform but follow consistent principles:
147
+
148
+ ### macOS
149
+ - ** System-wide** : ` /usr/local ` (preferred, like pkgm)
150
+ - ** User-specific** : ` ~/.local ` (fallback)
151
+ - ** Never uses** : ` /opt/homebrew ` (Homebrew's directory)
152
+
153
+ ### Linux
154
+ - ** System-wide** : ` /usr/local ` (preferred, like pkgm)
155
+ - ** User-specific** : ` ~/.local ` (fallback)
156
+ - ** Respects** : Existing system package manager directories
157
+
158
+ ### Windows
159
+ - ** User-specific** : ` %LOCALAPPDATA%\Programs\Launchpad ` (preferred)
160
+ - ** System-wide** : ` %PROGRAMFILES%\Launchpad ` (requires elevation)
108
161
109
- - ** macOS** : ` /usr/local ` (traditional) or ` /opt/homebrew ` (newer systems)
110
- - ** Linux** : ` /usr/local ` (system-wide) or ` ~/.local ` (user-specific)
111
- - ** Windows** : ` %LOCALAPPDATA% ` or ` %PROGRAMFILES% `
162
+ > [ !NOTE]
163
+ > Launchpad installs packages to ` /usr/local ` (like pkgm), not to Homebrew's ` /opt/homebrew ` directory. This ensures clean separation from Homebrew-managed packages and allows peaceful coexistence.
112
164
113
165
## Integration with pkgx
114
166
@@ -125,6 +177,10 @@ node --version
125
177
126
178
# Verify shim creation
127
179
ls -la ~ /.local/bin/node
180
+
181
+ # Test environment messages
182
+ cd my-project/ # Should show activation message
183
+ cd ../ # Should show deactivation message
128
184
```
129
185
130
186
``` powershell
@@ -134,6 +190,10 @@ node --version
134
190
135
191
# Verify shim creation
136
192
dir $env:USERPROFILE\.local\bin\node.exe
193
+
194
+ # Test environment messages
195
+ cd my-project # Should show activation message
196
+ cd ..\ # Should show deactivation message
137
197
```
138
198
139
199
## Cross-platform CI/CD Integration
@@ -149,9 +209,85 @@ jobs:
149
209
os : [ubuntu-latest, macos-latest, windows-latest]
150
210
runs-on : ${{ matrix.os }}
151
211
steps :
152
- - uses : actions/checkout@v2
212
+ - uses : actions/checkout@v4
153
213
- name : Install Launchpad
154
- run : npm install -g launchpad
214
+ run : npm install -g @stacksjs/ launchpad
155
215
- name : Install dependencies with Launchpad
156
216
run :
launchpad install node@22 [email protected]
217
+ - name : Test environment activation
218
+ run : |
219
+ cd test-project
220
+ # Environment should activate automatically with shell integration
221
+ ` ` `
222
+
223
+ ## Platform-specific Configuration
224
+
225
+ ### macOS Configuration
226
+
227
+ ` ` ` typescript
228
+ // launchpad.config.ts for macOS
229
+ export default {
230
+ installationPath : ' /usr/local' , // Preferred on macOS
231
+ shellActivationMessage : ' 🍎 macOS environment ready: {path}' ,
232
+ shellDeactivationMessage : ' 🍎 Environment closed' ,
233
+ // Use Homebrew paths for fallback when needed
234
+ fallbackPaths : ['/opt/homebrew/bin', '/usr/local/bin']
235
+ }
236
+ ```
237
+
238
+ ### Linux Configuration
239
+
240
+ ``` typescript
241
+ // launchpad.config.ts for Linux
242
+ export default {
243
+ installationPath: ' /usr/local' , // Preferred on Linux
244
+ shellActivationMessage: ' 🐧 Linux environment ready: {path}' ,
245
+ shellDeactivationMessage: ' 🐧 Environment closed' ,
246
+ // Respect system package manager paths
247
+ fallbackPaths: [' /usr/bin' , ' /usr/local/bin' ]
248
+ }
249
+ ```
250
+
251
+ ### Windows Configuration
252
+
253
+ ``` typescript
254
+ // launchpad.config.ts for Windows
255
+ export default {
256
+ installationPath: ` ${process .env .LOCALAPPDATA }\\ Programs\\ Launchpad ` ,
257
+ shellActivationMessage: ' 🪟 Windows environment ready: {path}' ,
258
+ shellDeactivationMessage: ' 🪟 Environment closed' ,
259
+ // Windows-specific paths
260
+ fallbackPaths: [' C:\\ Program Files\\ Git\\ bin' ]
261
+ }
262
+ ```
263
+
264
+ ## Troubleshooting Cross-platform Issues
265
+
266
+ ### Path Separator Issues
267
+
268
+ ``` bash
269
+ # Use path.join() for cross-platform compatibility
270
+ const installPath = path.join(baseDir, ' bin' , ' executable' )
271
+ ```
272
+
273
+ ### Environment Variable Differences
274
+
275
+ ``` bash
276
+ # Unix-like systems
277
+ export LAUNCHPAD_PATH=/usr/local
278
+
279
+ # Windows
280
+ set LAUNCHPAD_PATH=C:\u sr\l ocal
281
+ # or in PowerShell
282
+ $env :LAUNCHPAD_PATH = " C:\usr\local"
283
+ ```
284
+
285
+ ### Shell Integration Differences
286
+
287
+ ``` bash
288
+ # For Bash/Zsh (Unix-like)
289
+ echo ' eval "$(launchpad dev:shellcode)"' >> ~ /.zshrc
290
+
291
+ # For PowerShell (Windows)
292
+ Add-Content $PROFILE ' Invoke-Expression (& launchpad dev:shellcode)'
157
293
```
0 commit comments