coconuts 1.0.47 ā 1.0.48
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 -14
- package/package.json +5 -6
package/bin.js
CHANGED
|
@@ -12,17 +12,15 @@ const __dirname = dirname(__filename);
|
|
|
12
12
|
const [,, command, ...args] = process.argv;
|
|
13
13
|
|
|
14
14
|
if (command === 'serve') {
|
|
15
|
-
console.log('
|
|
15
|
+
console.log('šļø Starting Coconut...');
|
|
16
16
|
|
|
17
17
|
// Set environment variables
|
|
18
18
|
const currentDir = process.cwd();
|
|
19
|
-
console.log(`šļø Serving data from: ${currentDir}/.gait`);
|
|
20
19
|
process.env.GAIT_DATA_PATH = currentDir;
|
|
21
20
|
|
|
22
|
-
// Check if .
|
|
23
|
-
if (!fs.existsSync(join(currentDir, '.
|
|
24
|
-
console.error('
|
|
25
|
-
console.error(' Run "nut init" to initialize GAIT.');
|
|
21
|
+
// Check if .nut directory exists
|
|
22
|
+
if (!fs.existsSync(join(currentDir, '.nut'))) {
|
|
23
|
+
console.error('ā ļø Coconut is not initialized in this directory. Run "nut init" to initialize.');
|
|
26
24
|
process.exit(1);
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -35,8 +33,6 @@ if (command === 'serve') {
|
|
|
35
33
|
// Dynamic import to avoid issues with ES modules
|
|
36
34
|
const { startServer } = await import('@lovelybunch/api');
|
|
37
35
|
|
|
38
|
-
console.log(`š Starting server on port ${port}...`);
|
|
39
|
-
|
|
40
36
|
// Start the Hono API server with static frontend
|
|
41
37
|
const server = await startServer({
|
|
42
38
|
port: parseInt(port),
|
|
@@ -44,32 +40,33 @@ if (command === 'serve') {
|
|
|
44
40
|
});
|
|
45
41
|
|
|
46
42
|
const url = `http://${host}:${port}`;
|
|
47
|
-
console.log(
|
|
43
|
+
console.log(`š„„ Coconut ready at ${url}`);
|
|
48
44
|
|
|
49
45
|
// Open browser automatically
|
|
50
46
|
setTimeout(() => {
|
|
51
47
|
const openCommand = process.platform === 'darwin' ? 'open' :
|
|
52
48
|
process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
53
49
|
spawn(openCommand, [url], { detached: true, stdio: 'ignore' });
|
|
54
|
-
console.log(
|
|
50
|
+
console.log('š Opening in your browser...');
|
|
55
51
|
}, 1000);
|
|
56
52
|
|
|
57
53
|
// Handle graceful shutdown
|
|
58
54
|
process.on('SIGINT', () => {
|
|
59
|
-
console.log('\n
|
|
55
|
+
console.log('\nš Shutting down Coconut...');
|
|
60
56
|
server.close(() => {
|
|
61
57
|
process.exit(0);
|
|
62
58
|
});
|
|
63
59
|
});
|
|
64
60
|
|
|
65
61
|
process.on('SIGTERM', () => {
|
|
62
|
+
console.log('\nš Shutting down Coconut...');
|
|
66
63
|
server.close(() => {
|
|
67
64
|
process.exit(0);
|
|
68
65
|
});
|
|
69
66
|
});
|
|
70
67
|
|
|
71
68
|
} catch (error) {
|
|
72
|
-
console.error(
|
|
69
|
+
console.error(`š Failed to start Coconut: ${error?.message ?? error}`);
|
|
73
70
|
process.exit(0);
|
|
74
71
|
}
|
|
75
72
|
|
|
@@ -78,8 +75,7 @@ if (command === 'serve') {
|
|
|
78
75
|
try {
|
|
79
76
|
await import('@lovelybunch/cli');
|
|
80
77
|
} catch (error) {
|
|
81
|
-
console.error(
|
|
82
|
-
console.error(' Make sure @lovelybunch/cli is built and available.');
|
|
78
|
+
console.error(`š Failed to load Coconut CLI: ${error?.message ?? error}`);
|
|
83
79
|
process.exit(1);
|
|
84
80
|
}
|
|
85
81
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coconuts",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.48",
|
|
4
|
+
"description": "The Coconut CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nut": "./bin.js"
|
|
@@ -12,21 +12,20 @@
|
|
|
12
12
|
],
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/
|
|
15
|
+
"url": "git+https://github.com/lovelybunch/coconut.git"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@lovelybunch/api": "^1.0.
|
|
22
|
-
"@lovelybunch/cli": "^1.0.
|
|
21
|
+
"@lovelybunch/api": "^1.0.48",
|
|
22
|
+
"@lovelybunch/cli": "^1.0.48"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=18.0.0"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"cli",
|
|
29
|
-
"gait",
|
|
30
29
|
"coconut",
|
|
31
30
|
"command-line"
|
|
32
31
|
],
|