acadex-cli 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/acadex +11 -1
- package/acadex.ps1 +8 -2
- package/bin/acadex.js +70 -0
- package/package.json +10 -4
package/acadex
CHANGED
|
@@ -352,13 +352,23 @@ case "$1" in
|
|
|
352
352
|
echo ""
|
|
353
353
|
;;
|
|
354
354
|
|
|
355
|
+
services)
|
|
356
|
+
echo -e "${GREEN}Starting background services (Queue + Scheduler + Reverb) for Herd/Laragon...${NC}"
|
|
357
|
+
echo -e "${BLUE}→${NC} Use this when Herd/Laragon is already handling the web server"
|
|
358
|
+
npx concurrently -c "#c4b5fd,#4ade80,#fbbf24" \
|
|
359
|
+
"php artisan queue:work --tries=3 --timeout=90" \
|
|
360
|
+
"php artisan schedule:work" \
|
|
361
|
+
"php artisan reverb:start" \
|
|
362
|
+
--names=queue,scheduler,reverb
|
|
363
|
+
;;
|
|
355
364
|
serve)
|
|
356
365
|
echo -e "${GREEN}Starting production servers (Laravel + Queue + Scheduler + Reverb)...${NC}"
|
|
357
366
|
npx concurrently -c "#93c5fd,#c4b5fd,#4ade80,#fbbf24" \
|
|
358
367
|
"php artisan serve" \
|
|
359
368
|
"php artisan queue:work --tries=3 --timeout=90" \
|
|
360
369
|
"php artisan schedule:work" \
|
|
361
|
-
|
|
370
|
+
"php artisan reverb:start" \
|
|
371
|
+
--names=server,queue,scheduler,reverb
|
|
362
372
|
;;
|
|
363
373
|
dev)
|
|
364
374
|
echo -e "${GREEN}Starting development servers (Laravel + Queue + Logs + Vite + Reverb)...${NC}"
|
package/acadex.ps1
CHANGED
|
@@ -390,9 +390,15 @@ switch ($Command) {
|
|
|
390
390
|
Write-Host ""
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
+
"services" {
|
|
394
|
+
Write-Host "Starting background services (Queue + Scheduler + Reverb) for Herd/Laragon..." -ForegroundColor Green
|
|
395
|
+
Write-Host " -> Use this when Herd/Laragon is already handling the web server" -ForegroundColor Cyan
|
|
396
|
+
npx concurrently -c "#c4b5fd,#4ade80,#fbbf24" "php artisan queue:work --tries=3 --timeout=90" "php artisan schedule:work" "php artisan reverb:start" --names=queue,scheduler,reverb
|
|
397
|
+
}
|
|
398
|
+
|
|
393
399
|
"serve" {
|
|
394
|
-
Write-Host "Starting production servers (Laravel + Queue + Scheduler)..." -ForegroundColor Green
|
|
395
|
-
npx concurrently -c "#93c5fd,#c4b5fd,#4ade80" "php artisan serve" "php artisan queue:work --tries=3 --timeout=90" "php artisan schedule:work" --names=server,queue,scheduler
|
|
400
|
+
Write-Host "Starting production servers (Laravel + Queue + Scheduler + Reverb)..." -ForegroundColor Green
|
|
401
|
+
npx concurrently -c "#93c5fd,#c4b5fd,#4ade80,#fbbf24" "php artisan serve" "php artisan queue:work --tries=3 --timeout=90" "php artisan schedule:work" "php artisan reverb:start" --names=server,queue,scheduler,reverb
|
|
396
402
|
}
|
|
397
403
|
|
|
398
404
|
"dev" {
|
package/bin/acadex.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
// Use parent directory to access the scripts
|
|
10
|
+
const scriptDir = path.join(__dirname, '..');
|
|
11
|
+
|
|
12
|
+
let scriptPath;
|
|
13
|
+
let shell;
|
|
14
|
+
let shellArgs;
|
|
15
|
+
|
|
16
|
+
if (platform === 'win32') {
|
|
17
|
+
// Windows - use PowerShell script
|
|
18
|
+
scriptPath = path.join(scriptDir, 'acadex.ps1');
|
|
19
|
+
|
|
20
|
+
// Check if script exists
|
|
21
|
+
if (!fs.existsSync(scriptPath)) {
|
|
22
|
+
console.error(`Error: PowerShell script not found at ${scriptPath}`);
|
|
23
|
+
console.error('Please ensure acadex.ps1 is installed correctly.');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
shell = 'powershell.exe';
|
|
28
|
+
shellArgs = ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', scriptPath, ...process.argv.slice(2)];
|
|
29
|
+
|
|
30
|
+
console.log('Running on Windows - Using PowerShell');
|
|
31
|
+
} else {
|
|
32
|
+
// Unix-like systems (Linux, macOS) - use bash script
|
|
33
|
+
scriptPath = path.join(scriptDir, 'acadex');
|
|
34
|
+
|
|
35
|
+
// Check if script exists
|
|
36
|
+
if (!fs.existsSync(scriptPath)) {
|
|
37
|
+
console.error(`Error: Bash script not found at ${scriptPath}`);
|
|
38
|
+
console.error('Please ensure acadex bash script is installed correctly.');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Make sure the script is executable
|
|
43
|
+
try {
|
|
44
|
+
fs.chmodSync(scriptPath, '755');
|
|
45
|
+
} catch (err) {
|
|
46
|
+
// Ignore if we can't change permissions
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
shell = 'bash';
|
|
50
|
+
shellArgs = [scriptPath, ...process.argv.slice(2)];
|
|
51
|
+
|
|
52
|
+
const platformName = platform === 'darwin' ? 'macOS' : 'Linux';
|
|
53
|
+
console.log(`Running on ${platformName} - Using Bash`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const child = spawn(shell, shellArgs, {
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
shell: false
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
child.on('exit', (code) => {
|
|
62
|
+
process.exit(code || 0);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
child.on('error', (err) => {
|
|
66
|
+
console.error('Failed to start subprocess:', err.message);
|
|
67
|
+
console.error(`Platform: ${platform}`);
|
|
68
|
+
console.error(`Script path: ${scriptPath}`);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acadex-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A global CLI tool for managing Acadex projects with easy setup and automation",
|
|
5
|
-
"main": "acadex",
|
|
5
|
+
"main": "bin/acadex.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"acadex": "
|
|
7
|
+
"acadex": "bin/acadex.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"acadex",
|
|
12
|
+
"acadex.ps1",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
9
16
|
"scripts": {
|
|
10
17
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
18
|
},
|
|
@@ -32,4 +39,3 @@
|
|
|
32
39
|
"win32"
|
|
33
40
|
]
|
|
34
41
|
}
|
|
35
|
-
|