miolo 3.0.0-beta.207 → 3.0.0-beta.209

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.207",
3
+ "version": "3.0.0-beta.209",
4
4
  "description": "all-in-one koa-based server",
5
5
  "author": "Donato Lorenzo <donato@afialapis.com>",
6
6
  "contributors": [
@@ -47,7 +47,7 @@
47
47
  "@babel/plugin-proposal-decorators": "^7.29.7",
48
48
  "@babel/preset-env": "^7.29.7",
49
49
  "@babel/preset-react": "^7.29.7",
50
- "@dotenvx/dotenvx": "^1.71.0",
50
+ "@dotenvx/dotenvx": "^1.75.0",
51
51
  "@koa/bodyparser": "^6.1.0",
52
52
  "@koa/cors": "^5.0.0",
53
53
  "@koa/router": "^15.6.0",
@@ -58,8 +58,8 @@
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.0",
62
- "@tailwindcss/vite": "^4.3.0",
61
+ "@tailwindcss/postcss": "^4.3.1",
62
+ "@tailwindcss/vite": "^4.3.1",
63
63
  "@vitejs/plugin-react": "^6.0.2",
64
64
  "autoprefixer": "^10.5.0",
65
65
  "cacheiro": "^0.5.0-beta.11",
@@ -70,10 +70,10 @@
70
70
  "http-terminator": "^3.2.0",
71
71
  "intre": "^3.0.0-beta.4",
72
72
  "is-plain-object": "^5.0.0",
73
- "joi": "^18.2.1",
73
+ "joi": "^18.2.3",
74
74
  "jwt-simple": "^0.5.6",
75
75
  "koa": "^3.2.1",
76
- "koa-compress": "^5.2.1",
76
+ "koa-compress": "^5.2.2",
77
77
  "koa-connect": "^2.1.1",
78
78
  "koa-favicon": "^2.1.0",
79
79
  "koa-mount": "^4.2.0",
@@ -82,17 +82,17 @@
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.11",
86
- "nodemailer": "^8.0.10",
85
+ "nanoid": "^5.1.15",
86
+ "nodemailer": "^9.0.1",
87
87
  "passport-google-oauth20": "^2.0.0",
88
88
  "passport-local": "^1.0.0",
89
- "rollup": "^4.61.0",
89
+ "rollup": "^4.62.2",
90
90
  "rollup-plugin-node-externals": "^9.0.1",
91
91
  "rollup-plugin-postcss": "^4.0.2",
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.0",
95
+ "tailwindcss": "^4.3.1",
96
96
  "tinguir": "^0.0.7",
97
97
  "vite": "^8.0.16",
98
98
  "winston": "^3.19.0",
package/template/.env CHANGED
@@ -59,7 +59,7 @@ MIOLO_DB_POOL_IDLE_TIMEOUT_MS=10000
59
59
  # Logging
60
60
  #
61
61
 
62
- MIOLO_LOG_LEVEL=info
62
+ MIOLO_LOG_LEVEL=verbose
63
63
  MIOLO_LOG_CONSOLE_ENABLED=true
64
64
  MIOLO_LOG_FILE_ENABLED=false
65
65
  MIOLO_LOG_MAIL_ENABLED=false
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
3
3
  "files": {
4
4
  "includes": [
5
5
  "**/*",
@@ -27,29 +27,29 @@
27
27
  "#static/*": "./src/static/*"
28
28
  },
29
29
  "dependencies": {
30
- "@radix-ui/react-avatar": "^1.1.11",
31
- "@radix-ui/react-collapsible": "^1.1.12",
32
- "@radix-ui/react-dialog": "^1.1.15",
33
- "@radix-ui/react-dropdown-menu": "^2.1.16",
34
- "@radix-ui/react-label": "^2.1.8",
35
- "@radix-ui/react-select": "^2.2.6",
36
- "@radix-ui/react-separator": "^1.1.8",
37
- "@radix-ui/react-slot": "^1.2.4",
38
- "@radix-ui/react-tooltip": "^1.2.8",
39
- "@stepperize/react": "^6.1.0",
40
- "@tailwindcss/postcss": "^4.3.0",
30
+ "@radix-ui/react-avatar": "^1.2.0",
31
+ "@radix-ui/react-collapsible": "^1.1.14",
32
+ "@radix-ui/react-dialog": "^1.1.17",
33
+ "@radix-ui/react-dropdown-menu": "^2.1.18",
34
+ "@radix-ui/react-label": "^2.1.10",
35
+ "@radix-ui/react-select": "^2.3.1",
36
+ "@radix-ui/react-separator": "^1.1.10",
37
+ "@radix-ui/react-slot": "^1.3.0",
38
+ "@radix-ui/react-tooltip": "^1.2.10",
39
+ "@stepperize/react": "^7.0.0",
40
+ "@tailwindcss/postcss": "^4.3.1",
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
- "joi": "^18.2.1",
47
- "lucide-react": "^1.17.0",
48
- "miolo-cli": "^3.0.0-beta.207",
46
+ "joi": "^18.2.3",
47
+ "lucide-react": "^1.21.0",
48
+ "miolo-cli": "^3.0.0-beta.209",
49
49
  "miolo-model": "file:../miolo-model",
50
- "miolo-react": "^3.0.0-beta.207",
50
+ "miolo-react": "^3.0.0-beta.209",
51
51
  "next-themes": "^0.4.6",
52
- "radix-ui": "^1.4.3",
52
+ "radix-ui": "^1.6.0",
53
53
  "react": "^19.2.7",
54
54
  "react-dom": "^19.2.7",
55
55
  "react-router": "^7.16.0",
@@ -61,13 +61,12 @@
61
61
  "tw-animate-css": "^1.4.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@biomejs/biome": "2.4.16",
65
- "miolo": "^3.0.0-beta.207",
64
+ "@biomejs/biome": "2.5.0",
65
+ "miolo": "^3.0.0-beta.209",
66
66
  "sass-embedded": "^1.100.0"
67
67
  },
68
68
  "overrides": {
69
69
  "@babel/runtime": "^7.28.6",
70
- "ajv": "6.14.0",
71
70
  "body-parser": "^2.2.2",
72
71
  "cookie": "^1.1.1",
73
72
  "depd": "2.0.0",
@@ -17,7 +17,8 @@ const TodosProvider = ({ children }) => {
17
17
  data: todoList,
18
18
  setData: setTodoList,
19
19
  refresh: refreshTodoList,
20
- ready
20
+ ready,
21
+ invalidate: invalidateTodoList
21
22
  } = useSsrData("todos", {
22
23
  model: TodoList,
23
24
  loader: useCallback(
@@ -33,7 +34,8 @@ const TodosProvider = ({ children }) => {
33
34
  return data.sort((a, b) => b.created_at - a.created_at)
34
35
  },
35
36
  [useCrud, toast]
36
- )
37
+ ),
38
+ cache: true
37
39
  })
38
40
 
39
41
  const addTodo = useCallback(
@@ -1,4 +1,5 @@
1
1
  import { onTickFoo } from "./foo.mjs"
2
+ import { cacheInvalidate } from "./invalidate.mjs"
2
3
 
3
4
  // check https://github.com/kelektiv/node-cron#readme
4
5
  //
@@ -14,6 +15,13 @@ export default function init_cron() {
14
15
  start: true
15
16
  })
16
17
 
18
+ cronList.push({
19
+ name: "miolo-sample-cache-invalidate",
20
+ cronTime: "*/1 * * * *",
21
+ onTick: cacheInvalidate,
22
+ start: true
23
+ })
24
+
17
25
  console.log(`[miolo-sample][cron] ${cronList.length} custom cron jobs loaded`)
18
26
 
19
27
  return cronList
@@ -0,0 +1,21 @@
1
+ import { intre_now, intre_to_str } from "intre"
2
+ import { blue } from "tinguir"
3
+ import { db_todo_upsave } from "#server/io/db/todos/upsave.mjs"
4
+
5
+ export const cacheInvalidate = async (miolo) => {
6
+ miolo.logger.info(`${blue("[cron][cache_invalidate]")} Invalidating cache...`)
7
+
8
+ // broadcast an event to all clients
9
+ //miolo.io.emit("ssr-invalidate", { name: "todos" })
10
+
11
+ const ctx = { miolo }
12
+
13
+ await db_todo_upsave(ctx, {
14
+ description: `${intre_to_str(intre_now(), "DD/MM/YYYY HH:mm:ss")} - auto todo`,
15
+ done: false
16
+ })
17
+
18
+ miolo.io.emit("ssr-refresh", { name: "todos" })
19
+
20
+ miolo.logger.info(`${blue("[cron][cache_invalidate]")} Cache invalidated!`)
21
+ }