sandymount 0.0.6 → 0.0.7
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/sandymount.js +60 -21
- package/index.html +21 -0
- package/package.json +1 -1
- package/styles.css +58 -0
package/bin/sandymount.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { spawn } from 'child_process';
|
|
14
14
|
import { fileURLToPath } from 'url';
|
|
15
15
|
import { dirname, join } from 'path';
|
|
16
|
+
import { existsSync } from 'fs';
|
|
16
17
|
|
|
17
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
19
|
const __dirname = dirname(__filename);
|
|
@@ -20,16 +21,28 @@ const __dirname = dirname(__filename);
|
|
|
20
21
|
const args = process.argv.slice(2);
|
|
21
22
|
const command = args[0];
|
|
22
23
|
|
|
23
|
-
const VERSION = '0.0.
|
|
24
|
+
const VERSION = '0.0.7';
|
|
24
25
|
const DEFAULT_PORT = 5420;
|
|
25
26
|
|
|
26
|
-
function
|
|
27
|
+
function showBanner() {
|
|
27
28
|
console.log(`
|
|
28
|
-
|
|
29
|
+
███████╗ █████╗ ███╗ ██╗██████╗
|
|
30
|
+
██╔════╝██╔══██╗████╗ ██║██╔══██╗
|
|
31
|
+
███████╗███████║██╔██╗ ██║██║ ██║
|
|
32
|
+
╚════██║██╔══██║██║╚██╗██║██║ ██║
|
|
33
|
+
███████║██║ ██║██║ ╚████║██████╔╝
|
|
34
|
+
╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝
|
|
35
|
+
|
|
36
|
+
🏖️ Sandymount v${VERSION}
|
|
29
37
|
|
|
30
|
-
SAND Stack: Solid + ActivityPub + Nostr + DID
|
|
38
|
+
The SAND Stack: Solid + ActivityPub + Nostr + DID
|
|
39
|
+
Your data. Your identity. Your rules.
|
|
40
|
+
`);
|
|
41
|
+
}
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
function showHelp() {
|
|
44
|
+
showBanner();
|
|
45
|
+
console.log(`Usage:
|
|
33
46
|
sandymount [options] Start the server (default)
|
|
34
47
|
sandymount help Show this help
|
|
35
48
|
sandymount version Show version
|
|
@@ -40,13 +53,13 @@ Options:
|
|
|
40
53
|
--no-nostr Disable Nostr relay
|
|
41
54
|
--no-git Disable Git HTTP backend
|
|
42
55
|
--idp Enable identity provider
|
|
56
|
+
--activitypub Enable ActivityPub federation
|
|
43
57
|
--quiet Suppress logs
|
|
44
58
|
|
|
45
59
|
Examples:
|
|
46
60
|
npx sandymount
|
|
47
|
-
sandymount
|
|
48
61
|
sandymount --port 3000
|
|
49
|
-
|
|
62
|
+
sandymount --activitypub --idp
|
|
50
63
|
|
|
51
64
|
Website: https://sandy-mount.com
|
|
52
65
|
`);
|
|
@@ -56,6 +69,25 @@ function showVersion() {
|
|
|
56
69
|
console.log(`sandymount v${VERSION}`);
|
|
57
70
|
}
|
|
58
71
|
|
|
72
|
+
function findJss() {
|
|
73
|
+
// Try multiple locations for jss binary
|
|
74
|
+
const locations = [
|
|
75
|
+
// When installed as dependency (nested node_modules)
|
|
76
|
+
join(__dirname, '..', 'node_modules', '.bin', 'jss'),
|
|
77
|
+
// When using npx (hoisted node_modules)
|
|
78
|
+
join(__dirname, '..', '..', '.bin', 'jss'),
|
|
79
|
+
// Alternative hoisted location
|
|
80
|
+
join(__dirname, '..', '..', 'javascript-solid-server', 'bin', 'jss.js'),
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
for (const loc of locations) {
|
|
84
|
+
if (existsSync(loc)) {
|
|
85
|
+
return loc;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
59
91
|
function startServer(startArgs) {
|
|
60
92
|
const jssArgs = ['start'];
|
|
61
93
|
|
|
@@ -75,24 +107,31 @@ function startServer(startArgs) {
|
|
|
75
107
|
// Pass through all other args
|
|
76
108
|
jssArgs.push(...startArgs);
|
|
77
109
|
|
|
78
|
-
|
|
79
|
-
|
|
110
|
+
showBanner();
|
|
111
|
+
|
|
112
|
+
console.log(` Starting server on port ${startArgs.includes('--port') ? startArgs[startArgs.indexOf('--port') + 1] : DEFAULT_PORT}...`);
|
|
113
|
+
console.log(` Data directory: ${startArgs.includes('--root') ? startArgs[startArgs.indexOf('--root') + 1] : './data'}`);
|
|
80
114
|
console.log('');
|
|
81
115
|
|
|
82
|
-
// Find jss binary
|
|
83
|
-
const
|
|
84
|
-
|
|
116
|
+
// Find jss binary
|
|
117
|
+
const jssPath = findJss();
|
|
118
|
+
|
|
119
|
+
if (!jssPath) {
|
|
120
|
+
console.error(' ❌ Error: JSS (JavaScript Solid Server) not found.');
|
|
121
|
+
console.error('');
|
|
122
|
+
console.error(' This usually means dependencies were not installed correctly.');
|
|
123
|
+
console.error(' Try installing globally instead:');
|
|
124
|
+
console.error('');
|
|
125
|
+
console.error(' npm install -g sandymount');
|
|
126
|
+
console.error(' sandymount');
|
|
127
|
+
console.error('');
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const jss = spawn(jssPath, jssArgs, { stdio: 'inherit' });
|
|
85
132
|
|
|
86
133
|
jss.on('error', (err) => {
|
|
87
|
-
|
|
88
|
-
console.error('Error: JSS not found.');
|
|
89
|
-
console.error('');
|
|
90
|
-
console.error('JSS should be installed as a dependency. Try:');
|
|
91
|
-
console.error(' npm install -g sandymount');
|
|
92
|
-
console.error('');
|
|
93
|
-
} else {
|
|
94
|
-
console.error('Error:', err.message);
|
|
95
|
-
}
|
|
134
|
+
console.error(' ❌ Error:', err.message);
|
|
96
135
|
process.exit(1);
|
|
97
136
|
});
|
|
98
137
|
|
package/index.html
CHANGED
|
@@ -76,6 +76,18 @@
|
|
|
76
76
|
<a href="#projects" class="btn btn-secondary">Explore Projects</a>
|
|
77
77
|
<a href="./manifesto.html" class="btn btn-secondary">Read Manifesto</a>
|
|
78
78
|
</div>
|
|
79
|
+
<div class="quick-install">
|
|
80
|
+
<div class="install-box">
|
|
81
|
+
<code>npx sandymount</code>
|
|
82
|
+
<button class="copy-btn" onclick="copyCommand()" title="Copy to clipboard">
|
|
83
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
84
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
85
|
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
86
|
+
</svg>
|
|
87
|
+
</button>
|
|
88
|
+
</div>
|
|
89
|
+
<span class="install-note">Your own Solid pod in one command</span>
|
|
90
|
+
</div>
|
|
79
91
|
</header>
|
|
80
92
|
|
|
81
93
|
<!-- Stack Comparison -->
|
|
@@ -675,6 +687,15 @@
|
|
|
675
687
|
}
|
|
676
688
|
});
|
|
677
689
|
});
|
|
690
|
+
|
|
691
|
+
// Copy command to clipboard
|
|
692
|
+
function copyCommand() {
|
|
693
|
+
navigator.clipboard.writeText('npx sandymount').then(() => {
|
|
694
|
+
const btn = document.querySelector('.copy-btn');
|
|
695
|
+
btn.classList.add('copied');
|
|
696
|
+
setTimeout(() => btn.classList.remove('copied'), 1500);
|
|
697
|
+
});
|
|
698
|
+
}
|
|
678
699
|
</script>
|
|
679
700
|
</body>
|
|
680
701
|
</html>
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -430,6 +430,64 @@ a:hover { color: var(--accent-cyan); }
|
|
|
430
430
|
transform: translateY(-2px);
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
+
/* Quick Install */
|
|
434
|
+
.quick-install {
|
|
435
|
+
margin-top: 2.5rem;
|
|
436
|
+
display: flex;
|
|
437
|
+
flex-direction: column;
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: 0.5rem;
|
|
440
|
+
animation: fadeInUp 0.6s ease 0.5s forwards;
|
|
441
|
+
opacity: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.install-box {
|
|
445
|
+
display: flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
background: rgba(124, 58, 237, 0.08);
|
|
448
|
+
border: 1px solid rgba(124, 58, 237, 0.15);
|
|
449
|
+
border-radius: 8px;
|
|
450
|
+
overflow: hidden;
|
|
451
|
+
transition: all 0.2s ease;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.install-box:hover {
|
|
455
|
+
border-color: var(--accent);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.quick-install code {
|
|
459
|
+
font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
|
|
460
|
+
padding: 0.75rem 1rem 0.75rem 1.25rem;
|
|
461
|
+
font-size: 1rem;
|
|
462
|
+
color: var(--text);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.copy-btn {
|
|
466
|
+
background: transparent;
|
|
467
|
+
border: none;
|
|
468
|
+
border-left: 1px solid rgba(124, 58, 237, 0.15);
|
|
469
|
+
padding: 0.75rem 1rem;
|
|
470
|
+
cursor: pointer;
|
|
471
|
+
color: var(--text-muted);
|
|
472
|
+
transition: all 0.2s ease;
|
|
473
|
+
display: flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.copy-btn:hover {
|
|
478
|
+
background: rgba(124, 58, 237, 0.1);
|
|
479
|
+
color: var(--accent);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.copy-btn.copied {
|
|
483
|
+
color: var(--accent-green);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.install-note {
|
|
487
|
+
font-size: 0.85rem;
|
|
488
|
+
color: var(--text-muted);
|
|
489
|
+
}
|
|
490
|
+
|
|
433
491
|
/* Section styling */
|
|
434
492
|
.section {
|
|
435
493
|
padding: 5rem 2rem;
|