@rip-lang/server 0.7.7 → 0.7.8
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/package.json +1 -1
- package/server.html +1 -1
- package/server.rip +16 -1
package/package.json
CHANGED
package/server.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
<div>
|
|
34
34
|
<h1 class="text-2xl font-bold text-gray-900">Rip Server</h1>
|
|
35
|
-
<p class="text-sm text-gray-600">Multi-worker
|
|
35
|
+
<p class="text-sm text-gray-600">Multi-worker mode</p>
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
38
|
<div class="flex items-center space-x-2">
|
package/server.rip
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# bun server.rip list # List registered hosts
|
|
13
13
|
# ==============================================================================
|
|
14
14
|
|
|
15
|
-
import { existsSync, statSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'node:fs'
|
|
15
|
+
import { existsSync, statSync, readFileSync, writeFileSync, unlinkSync, mkdirSync, watch, utimesSync } from 'node:fs'
|
|
16
16
|
import { basename, dirname, isAbsolute, join, resolve } from 'node:path'
|
|
17
17
|
import { homedir, cpus, networkInterfaces } from 'node:os'
|
|
18
18
|
import { X509Certificate } from 'node:crypto'
|
|
@@ -476,6 +476,21 @@ class Manager
|
|
|
476
476
|
@rollingRestart!.finally => @isRolling = false
|
|
477
477
|
, 50
|
|
478
478
|
|
|
479
|
+
# Watch all .rip files in app directory - touch entry file on changes
|
|
480
|
+
entryFile = @flags.appEntry
|
|
481
|
+
entryBase = basename(entryFile)
|
|
482
|
+
try
|
|
483
|
+
watch @flags.appBaseDir, { recursive: true }, (event, filename) =>
|
|
484
|
+
return unless filename?.endsWith('.rip')
|
|
485
|
+
return if filename is entryBase or filename.endsWith("/#{entryBase}")
|
|
486
|
+
try
|
|
487
|
+
now = new Date()
|
|
488
|
+
utimesSync(entryFile, now, now)
|
|
489
|
+
catch
|
|
490
|
+
null
|
|
491
|
+
catch e
|
|
492
|
+
console.warn "rip-server: directory watch failed: #{e.message}"
|
|
493
|
+
|
|
479
494
|
stop: ->
|
|
480
495
|
for w in @workers
|
|
481
496
|
try w.process.kill() catch then null
|