miolo 3.0.0-beta.218 → 3.0.0-beta.219

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miolo",
3
- "version": "3.0.0-beta.218",
3
+ "version": "3.0.0-beta.219",
4
4
  "description": "all-in-one koa-based server",
5
5
  "author": "Donato Lorenzo <donato@afialapis.com>",
6
6
  "contributors": [
@@ -51,17 +51,17 @@
51
51
  "@koa/bodyparser": "^6.1.0",
52
52
  "@koa/cors": "^5.0.0",
53
53
  "@koa/router": "^15.6.0",
54
- "@maxmind/geoip2-node": "^6.3.4",
54
+ "@maxmind/geoip2-node": "^7.0.0",
55
55
  "@rollup/plugin-alias": "^6.0.0",
56
56
  "@rollup/plugin-babel": "^7.1.0",
57
57
  "@rollup/plugin-commonjs": "^29.0.3",
58
58
  "@rollup/plugin-json": "^6.1.0",
59
59
  "@rollup/plugin-node-resolve": "^16.0.3",
60
60
  "@rollup/plugin-replace": "^6.0.3",
61
- "@tailwindcss/postcss": "^4.3.1",
62
- "@tailwindcss/vite": "^4.3.1",
61
+ "@tailwindcss/postcss": "^4.3.2",
62
+ "@tailwindcss/vite": "^4.3.2",
63
63
  "@vitejs/plugin-react": "^6.0.3",
64
- "autoprefixer": "^10.5.1",
64
+ "autoprefixer": "^10.5.2",
65
65
  "cacheiro": "^0.5.0-beta.11",
66
66
  "calustra": "^1.0.0-beta.14",
67
67
  "cron": "^4.4.0",
@@ -82,7 +82,7 @@
82
82
  "koa-ratelimit": "^6.0.0",
83
83
  "koa-session": "^7.0.2",
84
84
  "koa-static": "^5.0.0",
85
- "nanoid": "^5.1.15",
85
+ "nanoid": "^5.1.16",
86
86
  "nodemailer": "^9.0.1",
87
87
  "passport-google-oauth20": "^2.0.0",
88
88
  "passport-local": "^1.0.0",
@@ -92,7 +92,7 @@
92
92
  "socket.io": "^4.8.3",
93
93
  "socket.io-client": "^4.8.3",
94
94
  "statuses": "^2.0.2",
95
- "tailwindcss": "^4.3.1",
95
+ "tailwindcss": "^4.3.2",
96
96
  "tinguir": "^0.0.7",
97
97
  "vite": "^8.1.0",
98
98
  "winston": "^3.19.0",
@@ -98,22 +98,23 @@ function init_socket(app, config) {
98
98
  }
99
99
  }
100
100
 
101
- io.emitSsrInvalidate = async (ctx, name) => {
102
- logger.verbose(`[socket] Emitting ssr-invalidate for ${name}`)
101
+ io.emitSsrRefresh = async (ctx, name, options) => {
102
+ const { lazy = false, excludeCurrent = false, onlyCurrent = false } = options || {}
103
+ logger.verbose(`[socket] Emitting ssr-refresh for ${name} ${lazy ? "(lazy)" : ""}`)
103
104
  try {
104
- const socketId = ctx.request?.headers?.["x-socket-id"]
105
- io.to(`ssr:${name}`).emit("ssr-invalidate", { name, exclude_socket_id: socketId })
106
- logger.verbose(`[socket] ssr-invalidate sent for ${name}`)
107
- } catch (err) {
108
- logger.error(`[socket] Error emitting ssr-invalidate: ${err.message}`)
109
- }
110
- }
105
+ const opts = { name, lazy }
106
+ if (excludeCurrent || onlyCurrent) {
107
+ const socketId = ctx.request?.headers?.["x-socket-id"]
108
+ if (socketId) {
109
+ if (excludeCurrent) {
110
+ opts.exclude_socket_id = socketId
111
+ } else {
112
+ opts.only_socket_id = socketId
113
+ }
114
+ }
115
+ }
111
116
 
112
- io.emitSsrRefresh = async (ctx, name) => {
113
- logger.verbose(`[socket] Emitting ssr-refresh for ${name}`)
114
- try {
115
- const socketId = ctx.request?.headers?.["x-socket-id"]
116
- io.to(`ssr:${name}`).emit("ssr-refresh", { name, exclude_socket_id: socketId })
117
+ io.to(`ssr:${name}`).emit("ssr-refresh", opts)
117
118
  logger.verbose(`[socket] ssr-refresh sent for ${name}`)
118
119
  } catch (err) {
119
120
  logger.error(`[socket] Error emitting ssr-refresh: ${err.message}`)
@@ -37,17 +37,17 @@
37
37
  "@radix-ui/react-slot": "^1.3.0",
38
38
  "@radix-ui/react-tooltip": "^1.2.10",
39
39
  "@stepperize/react": "^7.0.0",
40
- "@tailwindcss/postcss": "^4.3.1",
40
+ "@tailwindcss/postcss": "^4.3.2",
41
41
  "@tanstack/react-table": "^8.21.3",
42
42
  "class-variance-authority": "^0.7.1",
43
43
  "clsx": "^2.1.1",
44
44
  "farrapa": "^3.0.0-beta.10",
45
45
  "intre": "^3.0.0-beta.4",
46
46
  "joi": "^18.2.3",
47
- "lucide-react": "^1.21.0",
48
- "miolo-cli": "^3.0.0-beta.218",
47
+ "lucide-react": "^1.22.0",
48
+ "miolo-cli": "^3.0.0-beta.219",
49
49
  "miolo-model": "file:../miolo-model",
50
- "miolo-react": "^3.0.0-beta.218",
50
+ "miolo-react": "^3.0.0-beta.219",
51
51
  "next-themes": "^0.4.6",
52
52
  "radix-ui": "^1.6.0",
53
53
  "react": "^19.2.7",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@biomejs/biome": "2.5.1",
65
- "miolo": "^3.0.0-beta.218",
65
+ "miolo": "^3.0.0-beta.219",
66
66
  "sass-embedded": "^1.100.0"
67
67
  },
68
68
  "overrides": {
@@ -1,5 +1,6 @@
1
- import { Bomb, Bone, CircleQuestionMark, Phone, RefreshCw } from "lucide-react"
1
+ import { Bomb, Bone, CircleQuestionMark, Link, Phone, RefreshCw } from "lucide-react"
2
2
  import { useState } from "react"
3
+ import { useNavigate } from "react-router"
3
4
  import { Field, FieldContent, FieldLabel } from "#cli/components/ui/field.jsx"
4
5
  import { Button } from "#cli/components/ui/patched/button.jsx"
5
6
  import { Switch } from "#cli/components/ui/switch.jsx"
@@ -23,6 +24,12 @@ export default function TodoActions() {
23
24
  } = useTodosContext()
24
25
  const [hours, _setHours] = useState(1)
25
26
 
27
+ const navigate = useNavigate()
28
+
29
+ const forceURLChange = () => {
30
+ navigate("/?t=" + Date.now() /*, { replace: true }*/)
31
+ }
32
+
26
33
  return (
27
34
  <div className="flex flex-col gap-4 p-4">
28
35
  <h1 className="text-3xl font-bold text-center mb-8 text-gray-800 dark:text-white">Actions</h1>
@@ -67,6 +74,15 @@ export default function TodoActions() {
67
74
  <Phone size={18} />
68
75
  Ping through socket
69
76
  </Button>
77
+
78
+ <Button
79
+ onClick={() => forceURLChange()}
80
+ disabled={!canEdit}
81
+ className={`px-4 py-6 text-white rounded-lg transition-colors flex items-center gap-2 cursor-pointer ${useCrud ? "bg-pink-500 hover:bg-pink-400" : "bg-blue-500 hover:bg-blue-400"}`}
82
+ >
83
+ <Link size={18} />
84
+ Force URL change
85
+ </Button>
70
86
  </div>
71
87
 
72
88
  <h1 className="text-3xl font-bold text-center mt-8 mb-8 text-gray-800 dark:text-white">
@@ -35,5 +35,5 @@ export async function ch_todo_invalidate(ctx) {
35
35
  }
36
36
 
37
37
  ctx.miolo.logger.verbose(`[cache][todo] Invalidating connected clients`)
38
- await ctx.miolo.io.emitSsrRefresh(ctx, "todos")
38
+ await ctx.miolo.io.emitSsrRefresh(ctx, "todos", { excludeCurrent: true })
39
39
  }
@@ -6,9 +6,6 @@ import { db_todo_upsave } from "#server/io/db/todos/upsave.mjs"
6
6
  export const autoTodosInsert = async (miolo) => {
7
7
  miolo.logger.info(`${blue("[cron][auto-todos]")} Inserting auto todo...`)
8
8
 
9
- // broadcast an event to all clients
10
- //miolo.io.emit("ssr-invalidate", { name: "todos" })
11
-
12
9
  const ctx = { miolo }
13
10
 
14
11
  await db_todo_upsave(ctx, {
@@ -17,8 +14,6 @@ export const autoTodosInsert = async (miolo) => {
17
14
  })
18
15
 
19
16
  await ch_todo_invalidate({ miolo })
20
- //
21
- // miolo.io.emit("ssr-refresh", { name: "todos" })
22
17
 
23
18
  miolo.logger.info(`${blue("[cron][auto-todos]")} Done!`)
24
19
  }