@rip-lang/server 1.3.0 → 1.3.1

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/api.rip CHANGED
@@ -156,8 +156,9 @@ createContext = (req, params = {}) ->
156
156
  file = Bun.file(path)
157
157
  etag = "W/\"#{file.lastModified}-#{file.size}\""
158
158
  if req.headers.get('if-none-match') is etag
159
- return new Response(null, { status: 304, headers: { 'ETag': etag } })
159
+ return new Response(null, { status: 304, headers: { 'ETag': etag, 'Cache-Control': 'no-cache' } })
160
160
  out.set 'Content-Type', (type or mimeType(path))
161
+ out.set 'Cache-Control', 'no-cache'
161
162
  out.set 'ETag', etag
162
163
  new Response file, { status: 200, headers: out }
163
164
 
package/middleware.rip CHANGED
@@ -525,12 +525,12 @@ export serve = (opts = {}) ->
525
525
  get "#{prefix}/bundle", (c) ->
526
526
  glob = new Bun.Glob("**/*.rip")
527
527
  components = {}
528
- paths = Array.from(glob.scanSync(routesDir))
528
+ paths = Array.from(glob.scanSync(routesDir)).sort()
529
529
  for path in paths
530
530
  components["components/#{path}"] = Bun.file("#{routesDir}/#{path}").text!
531
531
 
532
532
  for dir in componentDirs
533
- incPaths = Array.from(glob.scanSync(dir))
533
+ incPaths = Array.from(glob.scanSync(dir)).sort()
534
534
  for path in incPaths
535
535
  key = "components/_lib/#{path}"
536
536
  components[key] = Bun.file("#{dir}/#{path}").text! unless components[key]
@@ -550,7 +550,7 @@ export serve = (opts = {}) ->
550
550
  # Register watch directories with rip-server via control socket
551
551
  if enableWatch and process.env.SOCKET_PREFIX
552
552
  ctl = "/tmp/#{process.env.SOCKET_PREFIX}.ctl.sock"
553
- dirs = [routesDir, ...componentDirs, "#{appDir}/css"]
553
+ dirs = [routesDir, ...componentDirs, "#{appDir}/css"].filter existsSync
554
554
  body = JSON.stringify({ op: 'watch', prefix, dirs })
555
555
  fetch('http://localhost/watch', { method: 'POST', body, headers: { 'content-type': 'application/json' }, unix: ctl }).catch (e) ->
556
556
  console.warn "[Rip] Watch registration failed: #{e.message}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Pure Rip web framework and application server",
5
5
  "type": "module",
6
6
  "main": "api.rip",
package/server.rip CHANGED
@@ -591,7 +591,7 @@ class Manager
591
591
  broadcast('css')
592
592
  watchers.push(w)
593
593
  catch e
594
- console.warn "rip-server: watch failed for #{dir}: #{e.message}"
594
+ console.warn "rip-server: watch failed for #{dir}:\n #{e.message}"
595
595
  @appWatchers.set prefix, { watchers, timer }
596
596
 
597
597
  spawnWorker: (version) ->