sandymount 0.0.2 → 0.0.4

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.
Files changed (2) hide show
  1. package/bin/sandymount.js +38 -31
  2. package/package.json +2 -2
package/bin/sandymount.js CHANGED
@@ -6,18 +6,17 @@
6
6
  * SAND Stack: Solid + ActivityPub + Nostr + DID
7
7
  *
8
8
  * Usage:
9
- * sandymount start [options] Start the SAND server
10
- * sandymount help Show help
9
+ * sandymount [options] Start the SAND server (default)
10
+ * sandymount help Show help
11
11
  */
12
12
 
13
13
  import { spawn } from 'child_process';
14
- import { fileURLToPath } from 'url';
15
- import { dirname, join } from 'path';
16
14
 
17
15
  const args = process.argv.slice(2);
18
16
  const command = args[0];
19
17
 
20
- const VERSION = '0.0.2';
18
+ const VERSION = '0.0.3';
19
+ const DEFAULT_PORT = 5420;
21
20
 
22
21
  function showHelp() {
23
22
  console.log(`
@@ -26,22 +25,23 @@ function showHelp() {
26
25
  SAND Stack: Solid + ActivityPub + Nostr + DID
27
26
 
28
27
  Usage:
29
- sandymount start [options] Start the server
30
- sandymount help Show this help
31
- sandymount version Show version
28
+ sandymount [options] Start the server (default)
29
+ sandymount help Show this help
30
+ sandymount version Show version
32
31
 
33
- Start Options:
34
- --port <n> Port to listen on (default: 3000)
32
+ Options:
33
+ --port <n> Port to listen on (default: ${DEFAULT_PORT})
35
34
  --root <path> Data directory (default: ./data)
36
- --nostr Enable Nostr relay
37
- --git Enable Git HTTP backend
35
+ --no-nostr Disable Nostr relay
36
+ --no-git Disable Git HTTP backend
38
37
  --idp Enable identity provider
39
38
  --quiet Suppress logs
40
39
 
41
40
  Examples:
42
- sandymount start
43
- sandymount start --port 8080 --nostr --git
44
- sand start --nostr --git
41
+ npx sandymount
42
+ sandymount
43
+ sandymount --port 3000
44
+ sand --idp
45
45
 
46
46
  Website: https://sandy-mount.com
47
47
  `);
@@ -51,18 +51,25 @@ function showVersion() {
51
51
  console.log(`sandymount v${VERSION}`);
52
52
  }
53
53
 
54
- function startServer() {
55
- // Pass through all arguments after 'start' to jss
56
- const jssArgs = ['start', ...args.slice(1)];
54
+ function startServer(startArgs) {
55
+ const jssArgs = ['start'];
57
56
 
58
- // Add defaults if not specified
59
- if (!args.includes('--nostr') && !args.includes('--no-nostr')) {
57
+ // Add default port if not specified
58
+ if (!startArgs.includes('--port') && !startArgs.includes('-p')) {
59
+ jssArgs.push('--port', String(DEFAULT_PORT));
60
+ }
61
+
62
+ // Add defaults: nostr and git ON unless disabled
63
+ if (!startArgs.includes('--nostr') && !startArgs.includes('--no-nostr')) {
60
64
  jssArgs.push('--nostr');
61
65
  }
62
- if (!args.includes('--git') && !args.includes('--no-git')) {
66
+ if (!startArgs.includes('--git') && !startArgs.includes('--no-git')) {
63
67
  jssArgs.push('--git');
64
68
  }
65
69
 
70
+ // Pass through all other args
71
+ jssArgs.push(...startArgs);
72
+
66
73
  console.log('');
67
74
  console.log('🏖️ Starting Sandymount...');
68
75
  console.log('');
@@ -87,22 +94,22 @@ function startServer() {
87
94
 
88
95
  // Main
89
96
  switch (command) {
90
- case 'start':
91
- startServer();
97
+ case 'help':
98
+ case '--help':
99
+ case '-h':
100
+ showHelp();
92
101
  break;
93
102
  case 'version':
94
103
  case '--version':
95
104
  case '-v':
96
105
  showVersion();
97
106
  break;
98
- case 'help':
99
- case '--help':
100
- case '-h':
101
- case undefined:
102
- showHelp();
107
+ case 'start':
108
+ // Explicit start, pass args after 'start'
109
+ startServer(args.slice(1));
103
110
  break;
104
111
  default:
105
- console.error(`Unknown command: ${command}`);
106
- console.error('Run "sandymount help" for usage.');
107
- process.exit(1);
112
+ // No command or unknown = start server, pass all args
113
+ startServer(args);
114
+ break;
108
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandymount",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "SAND Stack: Solid + ActivityPub + Nostr + DID — Personal sovereignty in one command",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -33,6 +33,6 @@
33
33
  },
34
34
  "homepage": "https://sandy-mount.com",
35
35
  "dependencies": {
36
- "javascript-solid-server": "^0.0.60"
36
+ "javascript-solid-server": "^0.0.62"
37
37
  }
38
38
  }