coconuts 1.0.56 → 1.0.58
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/bin.js +10 -7
- package/package.json +3 -3
package/bin.js
CHANGED
|
@@ -27,6 +27,7 @@ if (command === 'serve') {
|
|
|
27
27
|
// Find available port
|
|
28
28
|
const port = args.find(arg => arg.startsWith('--port='))?.split('=')[1] || '3000';
|
|
29
29
|
const host = args.find(arg => arg.startsWith('--host='))?.split('=')[1] || 'localhost';
|
|
30
|
+
const noOpen = args.includes('--no-open');
|
|
30
31
|
|
|
31
32
|
// Start the API server directly
|
|
32
33
|
try {
|
|
@@ -42,13 +43,15 @@ if (command === 'serve') {
|
|
|
42
43
|
const url = `http://${host}:${port}`;
|
|
43
44
|
console.log(`🥥 Coconut ready at ${url}`);
|
|
44
45
|
|
|
45
|
-
// Open browser automatically
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
// Open browser automatically unless --no-open flag is present
|
|
47
|
+
if (!noOpen) {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
const openCommand = process.platform === 'darwin' ? 'open' :
|
|
50
|
+
process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
51
|
+
spawn(openCommand, [url], { detached: true, stdio: 'ignore' });
|
|
52
|
+
console.log('🌐 Opening in your browser...');
|
|
53
|
+
}, 1000);
|
|
54
|
+
}
|
|
52
55
|
|
|
53
56
|
// Handle graceful shutdown
|
|
54
57
|
process.on('SIGINT', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coconuts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"description": "The Coconut CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@lovelybunch/api": "^1.0.
|
|
22
|
-
"@lovelybunch/cli": "^1.0.
|
|
21
|
+
"@lovelybunch/api": "^1.0.58",
|
|
22
|
+
"@lovelybunch/cli": "^1.0.58"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=18.0.0"
|