Skip to content

Commit b713558

Browse files
fix: resolve port/name inconsistencies and add --version (#1 phase 1) (#2)
- Unify default port on 5444 across README and CLI (was: README 3000 / code 5444) - Replace 7 jssd references with jspod (help banner, examples, URLs, env var) - Add -v/--version flag reading from package.json - Remove broken --verbose example from production deploy section - Bump jspod to 0.0.8 A new user following the README literally now hits a working URL, sees the correct binary name in help output, and can query the version. Refs #1
1 parent 6d92de8 commit b713558

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Run instantly with npx (no installation required!)
1414
npx jspod
1515

16-
# That's it! Your Solid server is running at http://localhost:3000
16+
# That's it! Your Solid server is running at http://localhost:5444
1717
```
1818

1919
## ✨ Features
@@ -61,7 +61,7 @@ npx jspod
6161
### Basic Usage
6262

6363
```bash
64-
# Start with defaults (port 3000, single-user)
64+
# Start with defaults (port 5444, single-user)
6565
jspod
6666

6767
# Custom port
@@ -78,7 +78,7 @@ jspod --multiuser
7878

7979
```
8080
Options:
81-
-p, --port <number> Port to listen on (default: 3000)
81+
-p, --port <number> Port to listen on (default: 5444)
8282
-h, --host <address> Host to bind to (default: 0.0.0.0)
8383
-r, --root <path> Data directory (default: ./pod-data)
8484
--multiuser Enable multi-user mode
@@ -125,7 +125,7 @@ jspod
125125

126126
5. **Monitor logs**
127127
```bash
128-
jspod --verbose > jspod.log 2>&1
128+
jspod > jspod.log 2>&1
129129
```
130130

131131
## 🏃 Quickstart Examples
@@ -136,7 +136,7 @@ jspod
136136
# Start your personal Solid pod
137137
jspod
138138

139-
# Visit http://localhost:3000 in your browser
139+
# Visit http://localhost:5444 in your browser
140140
# Register with passkey, start storing data!
141141
```
142142

@@ -195,7 +195,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options:
195195

196196
```javascript
197197
{
198-
port: 3000, // Easy to remember
198+
port: 5444, // Memorable, low collision with common dev servers
199199
host: '0.0.0.0', // Accept connections from anywhere
200200
root: './pod-data', // Local data directory
201201
multiuser: false, // Single pod per server
@@ -210,7 +210,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options:
210210
npx jspod
211211
```
212212

213-
**Step 2**: Open your browser to `http://localhost:3000`
213+
**Step 2**: Open your browser to `http://localhost:5444`
214214

215215
**Step 3**: Register with a passkey
216216
- Click "Register" or "Sign Up"
@@ -223,7 +223,7 @@ npx jspod
223223
- Your data stays on your server
224224

225225
**Troubleshooting**:
226-
- **Port in use?** Run `jspod --port 3001`
226+
- **Port in use?** Run `jspod --port 5445`
227227
- **Data location?** Check `./pod-data` directory
228228
- **Can't register?** Make sure your browser supports WebAuthn (Chrome, Firefox, Safari, Edge all work)
229229

index.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import { spawn } from 'child_process';
99
import { fileURLToPath } from 'url';
1010
import { dirname, join, delimiter } from 'path';
1111
import chalk from 'chalk';
12-
import { existsSync, mkdirSync } from 'fs';
12+
import { existsSync, mkdirSync, readFileSync } from 'fs';
1313

1414
const __dirname = dirname(fileURLToPath(import.meta.url));
15+
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
1516

1617
// Parse CLI arguments
1718
const args = process.argv.slice(2);
@@ -36,33 +37,37 @@ for (let i = 0; i < args.length; i++) {
3637
options.multiuser = true;
3738
} else if (arg === '--no-auth') {
3839
options.auth = false;
40+
} else if (arg === '--version' || arg === '-v') {
41+
console.log(`jspod v${pkg.version}`);
42+
process.exit(0);
3943
} else if (arg === '--help') {
4044
console.log(chalk.cyan(`
4145
╔═══════════════════════════════════════════════════════════════════╗
4246
║ jspod - Help ║
4347
╚═══════════════════════════════════════════════════════════════════╝
4448
`));
4549
console.log(chalk.white('Usage:'));
46-
console.log(chalk.yellow(' jssd') + chalk.dim(' [options]\n'));
50+
console.log(chalk.yellow(' jspod') + chalk.dim(' [options]\n'));
4751
console.log(chalk.white('Options:'));
4852
console.log(chalk.green(' -p, --port ') + chalk.yellow('<number>') + chalk.dim(' Port to listen on (default: 5444)'));
4953
console.log(chalk.green(' -h, --host ') + chalk.yellow('<address>') + chalk.dim(' Host to bind to (default: 0.0.0.0)'));
5054
console.log(chalk.green(' -r, --root ') + chalk.yellow('<path>') + chalk.dim(' Data directory (default: ./pod-data)'));
5155
console.log(chalk.green(' --multiuser') + chalk.dim(' Enable multi-user mode'));
5256
console.log(chalk.green(' --no-auth') + chalk.dim(' Disable authentication'));
57+
console.log(chalk.green(' -v, --version') + chalk.dim(' Show jspod version'));
5358
console.log(chalk.green(' --help') + chalk.dim(' Show this help message\n'));
5459
console.log(chalk.white('Examples:'));
55-
console.log(chalk.dim(' jssd'));
56-
console.log(chalk.dim(' jssd --port 8080 --root /var/pods'));
57-
console.log(chalk.dim(' jssd --multiuser\n'));
60+
console.log(chalk.dim(' jspod'));
61+
console.log(chalk.dim(' jspod --port 8080 --root /var/pods'));
62+
console.log(chalk.dim(' jspod --multiuser\n'));
5863
console.log(chalk.white('Features:'));
5964
console.log(chalk.dim(' • Solid Protocol compliant'));
6065
console.log(chalk.dim(' • WebID authentication'));
6166
console.log(chalk.dim(' • Passkey support'));
6267
console.log(chalk.dim(' • WebSocket notifications'));
6368
console.log(chalk.dim(' • JSON-LD native\n'));
6469
console.log(chalk.white('Resources:'));
65-
console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jssd'));
70+
console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jspod'));
6671
console.log(chalk.blue(' https://solidproject.org\n'));
6772
process.exit(0);
6873
} else {
@@ -111,7 +116,7 @@ console.log(chalk.cyan(' ├─ ') + chalk.green('Notifications ') + chal
111116
console.log(chalk.cyan(' └─ ') + chalk.green('JSON-LD Native ') + chalk.bold.green('✓'));
112117

113118
console.log('\n' + chalk.bold.white('📚 Resources:\n'));
114-
console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jssd'));
119+
console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jspod'));
115120
console.log(chalk.cyan(' ├─ ') + chalk.white('Solid: ') + chalk.blue.underline('https://solidproject.org'));
116121
console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.underline('https://www.w3.org/2005/Incubator/webid/spec'));
117122

@@ -138,7 +143,7 @@ const jss = spawn('jss', jssArgs, {
138143
env: {
139144
...process.env,
140145
PATH: `${join(__dirname, 'node_modules', '.bin')}${delimiter}${process.env.PATH}`,
141-
TOKEN_SECRET: process.env.TOKEN_SECRET || 'jssd-default-secret-change-in-production',
146+
TOKEN_SECRET: process.env.TOKEN_SECRET || 'jspod-default-secret-change-in-production',
142147
NODE_ENV: process.env.NODE_ENV || 'development'
143148
}
144149
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspod",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "JavaScript Solid Pod - Just works, batteries included",
55
"type": "module",
66
"main": "index.js",
@@ -37,6 +37,6 @@
3737
},
3838
"dependencies": {
3939
"chalk": "^5.6.2",
40-
"javascript-solid-server": "^0.0.186"
40+
"javascript-solid-server": "^0.0.194"
4141
}
4242
}

0 commit comments

Comments
 (0)