Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,23 @@ Under the hood, jspod runs JavaScriptSolidServer with these options:
|---------|----------|-------------|
| **WebSocket Notifications** | `--notifications` | Real-time updates via WebSockets |
| **Content Negotiation** | `--conneg` | Turtle, JSON-LD, and more |
| **Single-user Mode** | `--no-multiuser` | One pod per server (use `--multiuser` flag to change) |
| **Single-user Mode** | `--no-multiuser --single-user` | One pod per server (use `--multiuser` flag to change) |
| **Identity Provider** | `--idp` | Built-in IDP so the rung-1 sign-in works out of the box |
| **Tiny Data Browser** | `--mashlib-module` | ~200 bytes of JS + CSS shipped in this npm package, served from jsdelivr. Replaces the full mashlib bundle by default. |
| **Passkey Auth** | (built-in) | Automatic in JSS - no flag needed |
| **WebID** | (built-in) | Core Solid protocol feature |

### The page is the data

By default jspod uses a deliberately minimal data browser — a ~200-byte ES module that renders the JSON-LD data island JSS already embeds in each HTML response, with every URI turned into a clickable link. No SPA, no CDN bundle, no parsing — *the page is the data, and the URIs are the navigation*.

The browser source is two files in this npm package:

- [`data-browser.js`](./data-browser.js) — finds `#dataisland`, renders to `#mashlib`, makes URIs clickable
- [`data-browser.css`](./data-browser.css) — system font, cream background, soft card

JSS loads them from a version-pinned jsdelivr URL: `https://cdn.jsdelivr.net/npm/jspod@<version>/data-browser.js`. Override with `--mashlib-cdn` (full mashlib from CDN) or `--no-mashlib` (raw RDF responses) via your own JSS invocation if you want something else.

### Default Configuration

```javascript
Expand Down
6 changes: 6 additions & 0 deletions data-browser.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* jspod minimal data-browser styles. Auto-loaded by JSS as the .css
sibling of data-browser.js (see generateModuleDatabrowserHtml). */
body{font:14px/1.6 system-ui,-apple-system,sans-serif;margin:2em;color:#222;background:#fafaf8}
#mashlib pre{padding:1em;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:auto;white-space:pre-wrap;word-break:break-all}
a{color:#0366d6;text-decoration:none}
a:hover{text-decoration:underline}
5 changes: 5 additions & 0 deletions data-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// jspod minimal data browser — the page is the data. JSS embeds the
// resource as JSON-LD in #dataisland; this module just makes it visible
// in #mashlib with clickable URIs. See data-browser.css for the styling.
const d=document.getElementById('dataisland'),m=document.getElementById('mashlib');
m.innerHTML=`<pre>${d.textContent.replace(/https?:\/\/[^"\s]+/g,'<a href="$&">$&</a>')}</pre>`
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,24 @@ console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.
console.log('\n' + chalk.dim('Press ') + chalk.bold.red('Ctrl+C') + chalk.dim(' to stop the server\n'));
console.log(chalk.yellow('⏳ Initializing server components...\n'));

// Point JSS at jspod's minimal data browser instead of the full mashlib
// bundle. The page-is-the-data philosophy: JSS already embeds the
// resource as JSON-LD in #dataisland, so the "browser" only needs to
// paint that data with clickable URIs (~200 bytes of JS + ~200 bytes
// of CSS, both shipped in this npm package). Version-pinned jsdelivr
// URL is immutable per version, so a published jspod release will
// always load the matching browser code.
const dataBrowserUrl = `https://cdn.jsdelivr.net/npm/jspod@${pkg.version}/data-browser.js`;

// Build jss arguments
const jssArgs = [
'start',
'--port', options.port.toString(),
'--host', options.host,
'--root', options.root,
'--notifications',
'--conneg'
'--conneg',
'--mashlib-module', dataBrowserUrl
];

if (options.multiuser) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "jspod",
"version": "0.0.10",
"version": "0.0.11",
"description": "JavaScript Solid Pod - Just works, batteries included",
"type": "module",
"main": "index.js",
"bin": {
"jspod": "index.js"
},
"files": [
"index.js"
"index.js",
"data-browser.js",
"data-browser.css"
],
"scripts": {
"start": "node index.js"
Expand Down