@rip-lang/server 1.1.4 → 1.1.5
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/README.md +7 -7
- package/bin/rip-server +5 -9
- package/package.json +3 -3
- package/server.rip +2 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<img src="https://raw.githubusercontent.com/shreeve/rip-lang/main/docs/rip.
|
|
1
|
+
<img src="https://raw.githubusercontent.com/shreeve/rip-lang/main/docs/rip.png" style="width:50px" /> <br>
|
|
2
2
|
|
|
3
3
|
# Rip Server - @rip-lang/server
|
|
4
4
|
|
|
@@ -472,7 +472,7 @@ import { ripUI } from '@rip-lang/ui/serve'
|
|
|
472
472
|
|
|
473
473
|
dir = import.meta.dir
|
|
474
474
|
|
|
475
|
-
use ripUI
|
|
475
|
+
use ripUI dir: dir, components: 'pages', includes: ['ui'], watch: true, title: 'My App'
|
|
476
476
|
|
|
477
477
|
get '/css/*', -> @send "#{dir}/css/#{@req.path.slice(5)}"
|
|
478
478
|
|
|
@@ -489,9 +489,9 @@ rip-server -w
|
|
|
489
489
|
|
|
490
490
|
This gives you:
|
|
491
491
|
|
|
492
|
-
- **Framework
|
|
493
|
-
- **
|
|
494
|
-
- **Hot reload** via SSE at `/
|
|
492
|
+
- **Framework bundle** served at `/rip/rip-ui.min.js`
|
|
493
|
+
- **App bundle** auto-generated at `/{app}/bundle`
|
|
494
|
+
- **Hot reload** via SSE at `/{app}/watch` — save a `.rip` file and the browser
|
|
495
495
|
updates instantly
|
|
496
496
|
- **HTTPS + mDNS** — access at `https://myapp.local`
|
|
497
497
|
- **Multi-worker** — load balanced across CPU cores
|
|
@@ -503,8 +503,8 @@ When running with `-w`, two layers of hot reload work together:
|
|
|
503
503
|
|
|
504
504
|
1. **rip-server file watching** (`-w` flag) — watches for `.rip` file changes
|
|
505
505
|
and triggers rolling worker restarts (server-side reload)
|
|
506
|
-
2. **ripUI SSE watching** (`watch: true`) — watches the pages
|
|
507
|
-
notifies connected browsers via SSE (client-side reload)
|
|
506
|
+
2. **ripUI SSE watching** (`watch: true`) — watches the `pages/` and `includes`
|
|
507
|
+
directories and notifies connected browsers via SSE (client-side reload)
|
|
508
508
|
|
|
509
509
|
For development, the SSE hot-reload is usually sufficient — it recompiles
|
|
510
510
|
components in the browser without restarting workers. The `-w` flag is useful
|
package/bin/rip-server
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { execFileSync } from 'child_process';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { dirname, join } from 'path';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const __dirname = dirname(__filename);
|
|
9
|
-
|
|
10
|
-
const serverRip = join(__dirname, '..', 'server.rip');
|
|
11
|
-
const args = process.argv.slice(2).join(' ');
|
|
7
|
+
const serverRip = join(dirname(fileURLToPath(import.meta.url)), '..', 'server.rip');
|
|
12
8
|
|
|
13
9
|
try {
|
|
14
|
-
|
|
15
|
-
} catch (
|
|
16
|
-
process.exit(
|
|
10
|
+
execFileSync('rip', [serverRip, ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
11
|
+
} catch (e) {
|
|
12
|
+
process.exit(e.status || 1);
|
|
17
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rip-lang/server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Pure Rip application server — multi-worker, hot reload, HTTPS, mDNS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server.rip",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"author": "Steve Shreeve <steve.shreeve@gmail.com>",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"rip-lang": "^3.
|
|
42
|
-
"@rip-lang/api": "^1.1.
|
|
41
|
+
"rip-lang": "^3.9.1",
|
|
42
|
+
"@rip-lang/api": "^1.1.6"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"bin/",
|
package/server.rip
CHANGED
|
@@ -690,12 +690,13 @@ class Server
|
|
|
690
690
|
# Helper to start server, incrementing port if needed
|
|
691
691
|
startOnPort = (p, opts = {}) =>
|
|
692
692
|
port = p
|
|
693
|
-
while
|
|
693
|
+
while port < p + 100
|
|
694
694
|
try
|
|
695
695
|
return Bun.serve(Object.assign({ port, idleTimeout: 8, fetch: fetchFn }, opts))
|
|
696
696
|
catch e
|
|
697
697
|
throw e unless e?.code is 'EADDRINUSE'
|
|
698
698
|
port++
|
|
699
|
+
throw new Error "No available port found (tried #{p}–#{p + 99})"
|
|
699
700
|
|
|
700
701
|
if httpOnly
|
|
701
702
|
if @flags.httpPort is 0
|
|
@@ -820,8 +821,6 @@ class Server
|
|
|
820
821
|
worker.inflight = 0
|
|
821
822
|
if @isCurrentVersion(worker)
|
|
822
823
|
@availableWorkers.push(worker)
|
|
823
|
-
# Force array mutation to be visible (workaround for timing issue)
|
|
824
|
-
@availableWorkers.length
|
|
825
824
|
|
|
826
825
|
logAccess: (req, res, totalSeconds, workerSeconds) ->
|
|
827
826
|
if @flags.jsonLogging
|